Languages
Top community members

Welcome to Dirask IT community! ❀ đŸ’»
We are community that shares solutions with each other.

If you think you have something to add here.

you are welcome with your fresh ideas - List Articles

[Edit]
EN

Gatsby - static resources (js, css, gfx)

3 points
Created by:
AnnLen
1666

In this short article we would like to show the simplest way how to use static resources in Gatsby. This way it is possible to attach any additional js file, css style file or image to project.

Simple steps:

  1. create static/ directory directly in your Gatsby project,
  2. paste inside static/ directory some files or directores, e.g.
    my-style.css
    my-script.js
    my-image.png
    some-dir/my-image.css
    some-dir/my-script.js
    some-dir/my-image.png
  3. access resources directly with:
    http://localhost:8000/my-style.css
    http://localhost:8000/my-script.js
    http://localhost:8000/my-image.png
    http://localhost:8000/some-dir/my-image.css
    http://localhost:8000/some-dir/my-script.js
    http://localhost:8000/some-dir/my-image.png

Note: official documentation is located here.

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey 👋
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more