Exclude specific SCSS file in node modules while building using webpack 3

413 Views Asked by At

How can I exclude only one .SCSS file from node modules using webpack 3 (preventing from appending style to dom using style loader). I am using webpack module rules.

I have many .scss file where I want to load that file only on demand instead of appending that at initial time using style-loader. So I am excluding that particular file where I have another idea to do. As of now while excluding that particular .scss file I am facing issue.

Using include rule I am adding all from /node_modules/

And if I use exclude: it throws an error like Use an appropriate loader to resolve this.

Eg: .... exclude: ['./node_modules/aaaaa/dist/styles/filename.scss'], ....

Any idea or suggestion on this? How can I exclude specific SCSS FILE using webpack 3

Also I am using style-loader, css-loader and sass-loader.

0

There are 0 best solutions below