You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
However, there is an **escape hatch** that you can use to add an asset outside of the module system.
11
+
しかし、モジュールシステムを使わずにアセットを追加することもできます。
13
12
14
-
## Adding assets outside of the module system
13
+
## モジュールシステムを使わずにアセットを追加する
15
14
16
-
You can create a folder named `static`at the root of your project. Every file you put into that folder will be copied into the `public`folder. E.g. if you add a file named `sun.jpg`to the static folder, it'll be copied to `public/sun.jpg`
- You have thousands of images and need to dynamically reference their paths.
52
-
- You want to include a small script like
53
-
[`pace.js`](http://github.hubspot.com/pace/docs/welcome/) outside of the
54
-
bundled code.
55
-
- Some libraries may be incompatible with Webpack and you have no other option but to include it as a `<script>` tag.
56
-
- You need to import JSON file that doesn't have a consistent schema, like [TopoJSON files](https://en.wikipedia.org/wiki/GeoJSON#TopoJSON), which is difficult to handle with GraphQL. Note that importing JSON files directly inside a page, a template, or a component using `import` syntax results in adding that file to the app bundle and increasing the size of all site's pages. Instead, it's better to place your JSON file inside the `static` folder and use the dynamic import syntax (`import('/static/myjson.json')`) within the `componentDidMount` lifecycle or the `useEffect` hook.
0 commit comments