Closed mshafiqmk closed 5 years ago
It is expected, because file-loader
generate file and doesn't parse content. You don't need file-loader
for json
in webpack@4
. Also using file-loader
increase you bundle size because tree shaking doesn't work
@evilebottnawi thanks , i want to use same json file before and after build
if you see here the index.bundle.js file have reference to that json file ?
i have try json file-loader it just append the content of json file like that : but i want to load this json content from file.
Use javascript/auto
or json
https://github.com/webpack/webpack/blob/master/lib/WebpackOptionsDefaulter.js#L60
i have already try this option it doesn't work for me . It append the json file into bundle.js , i don't want this . i want to copy json file to build folder and then the generated build(bundle.js) file should use that copied file ?
It is impossible, use multicompile mode
Thanks @evilebottnawi , can you please share some link or example of multiple mode ?
@shafiqkhuidad looks on documentation
Expected Behavior
should log values inside x.json file
Actual Behavior
it log name of the generated json file in the build
Code
i have created simple demo , here is the link to code repo https://github.com/shafiqkhuidad/WebpackLoaders-Demo
How Do We Reproduce?