Excluding less load from webpacks

I use Webpack to compile my JavaScript packages and am very happy with it. I also use it to compile my LESS files into CSS with help ExtractTextPlugin, which also works very well. I started to study the size of the end of the package and its makeup and found something that I would like to fix:

Package size breakdown

less-loaderoccupies 9.9% of the package size. This in itself is, however, it really seems to me that I do not think that it is really needed in the kit. I already extracted CSS as my own file and am not doing any of require('./component.less')my JavaScript modules anywhere.

Is there a way to ask webpack to exclude it so as not to spoil the compilation lesscss?

+4
2

ExtractTextPlugin JS. , , .

, , , "".

+2

, webpack-visualizer.

node_modules/less-loader → index.js, ( loaderUtils.parseQuery) .

, .

0

Source: https://habr.com/ru/post/1662393/


All Articles