file-loader support json file code example
Example 1: file-loader support json file
{
type: 'javascript/auto',
test: /\.json$/,
use: ['file-loader'],
include: /\/dir\/.*\.json$/,
options: {
name: 'static/json/[name].[hash:8].[ext]',
}
},
Example 2: file-loader support json file
{
type: 'javascript/auto',
test: /\.json$/,
use: [ 'file-loader' ],
include: /\.\/config/ // for e.g, but better to only copy particular JSON files (not all)
}