Languages
[Edit]
EN

Gatsby - static resources (js, css, gfx)

3 points
Created by:
AnnLen
1879

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.

Native Advertising
50 000 ad impressions - 449$
ūüöÄ
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

‚̧ԳŹūüíĽ ūüôā

Join