I have a directory full of JSON files. I am trying to write a function to load one of them by name at runtime. When I am using Webpack, I can just do something like this:
const data = await import(`~/resources/levels-progression/${chapterName}.json`);
However, I am currently using Parcel, and doing that just results in an error:
TypeError: error resolving module specifier '~/resources/levels-progression/functions.json'
It seems that Parcel ignores my import when I do it this way. How can I fix this?