Import JSON file in build folder instead js file #8242
-
Clear and concise description of the problem
Suggested solutionI'm not sure AlternativeImport json file dynamically instead hardcode when build Additional contextNo response Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Converting to discussion as this is a question. |
Beta Was this translation helpful? Give feedback.
-
If you want to load const res = await fetch('/cbs.json')
const data = await res.json() |
Beta Was this translation helpful? Give feedback.
If you want to load
dist/cbs.json
, you need to usefetch
notimport
.