EN
Gatsby - static resources (js, css, gfx)
6
points
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:
- create
static/
 directory directly in yourÂGatsby
project, - 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
- 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.