webpack-node-externals
webpack-node-externals copied to clipboard
css files from node_modules are still being included
I'm using this plugin as such:
externals: [
nodeExternals(),
],
In one of my sass files, I do
@import '~normalize/normalize.css'
The generated server bundle still contains the entire normalize.css as a string.
Are you using the ignorePlugin by any chance?? Will need the full webpack.config to be able to provide better insight.
new webpack.IgnorePlugin(/\.(css|less)$/)
sass-loader just compiles your sass through node-sass. You can see it here
Which result you does expect? You need to compile sass but normalize should stay as import statement? It looks weird.
https://www.npmjs.com/package/webpack-node-externals#how-can-i-bundle-required-assets-ie-css-files-from-node_modules