easy-webpack / core

An easy way to create configuration files for Webpack
MIT License
68 stars 6 forks source link

Investigate ExtractTextPlugin not firing correctly with CSS loaders #8

Closed niieani closed 7 years ago

niieani commented 8 years ago

┆Issue is synchronized with this Asana task

delebash commented 8 years ago

config-sass

Looking into this as best as I can. How are you using the Spread operator in this line loaders: extractCss ? extractText.extract(...loaders.slice(1)) : loaders

It is already an array so slice is already available. I am not sure why but if you remove the Spread operator the extract works.

Interesting note is that without the Spread operator you get this value returned as the sass loader {"remove":true,"id":1}!css!sass

With the Spread operator you get this value returned {"omit":1,"extract":true,"remove":true,"id":1}!css!sass

Another note is that if I use extractText =true on both the config-css and config-sass that is not using the spread operator only the sass file is extracted, other css files such asimport 'font-awesome/css/font-awesome.css'; in index.js file are not extracted

niieani commented 7 years ago

Fixed in https://github.com/easy-webpack/config-css/commit/7fa3a29cabc1e6c48da66962be2ba255f0740e07