Skip to content

Embed a raw JSON file in Webpack #16473

Discussion options

You must be logged in to vote

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 use fetch to access it on runtime.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@koleto
Comment options

Answer selected by koleto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants