FountainJS / generator-fountain-webpack

Yeoman 'fountain' generator which handle the Webpack config
http://fountainjs.io
MIT License
4 stars 6 forks source link

Wrong line on cssLoaders when using ExtractTextPlugin #40

Closed AlbertoFdzM closed 8 years ago

AlbertoFdzM commented 8 years ago

There is a wrong usage of ExtractTextPlugin when configuring the css loader that is not loading the postcss-loader well.

zckrs commented 8 years ago

Hi thank you for PR. Just curiosity but do you have a link to webpack conf about that?

AlbertoFdzM commented 8 years ago

Sure, https://github.com/webpack/extract-text-webpack-plugin/tree/webpack-1#api

The correct usage is:

ExtractTextPlugin.extract([notExtractLoader], loader, [options]);

So in the case of angular1/js/sass for example it should be like:

ExtractTextPlugin.extract('styles', 'css?minimize!sass!postcss');

Instead of:

ExtractTextPlugin.extract('styles', 'css?minimize!sass', 'postcss');

In the last one ExtractTextPlugin will undertand that 'postcss' is the options arg and will not pay atention to it.

You can try it by creating a web project using angular1/sass/js and modifying the index.scss file with something like:

body {
  display: flex;
}

that should be processed by the postcsss-loader using autoprefiexer and output:

body{display:-webkit-box;display:-ms-flexbox;display:flex;}

But this code is not being generated.

Swiip commented 8 years ago

Perfect, thanks