Webpack 4: Mini-Css-Extract-Plugin + File-Loader Not Loading Assets

Webpack - MiniCssExtractPlugin doesn't extract file

Note that any imported file is subject to tree shaking. This means if you use something like css-loader in your project and import a CSS file, it needs to be added to the side effect list so it will not be unintentionally dropped in production mode.
Blockquote

in your package.json, add:

"sideEffects": [
'.scss'
]

webpack file-loader does not load background image

Adding esModule: false inside the url-loader options the image helped me, though I'm not sure why, if someone has the same issue you should try this trick.



Related Topics



Leave a reply



Submit