Embed a raw JSON file in Webpack #16473
-
For a webpack based project I need to include options.json file without modifying the name or minifying it so that I can exchange the file options.json on the server directory and, still be able to import the modified options.json in the app. Something like: How to include this into I try to use 'static' and can use it like: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What you want instead is to put it into |
Beta Was this translation helpful? Give feedback.
raw-loader
will load the file as a string, so it will be a static value on runtime. So, there will not be any file to exchange it later.What you want instead is to put it into
/src/public
, then usefetch
to access it on runtime.