@lew
To access a JSON static file imported with webpack, you can follow these steps:
Make sure that you have the necessary webpack configuration to handle JSON files. This can be done by including the json-loader in your webpack configuration file (webpack.config.js):
1 2 3 4 5 6 7 8 9 |
module: {
rules: [
{
test: /.json$/,
use: 'json-loader',
type: 'javascript/auto'
}
]
}
|
After setting up the json-loader in your webpack configuration, you should be able to import and access the JSON static file in your code using webpack.