Use postcss-loader instead of autoprefixer-loader
ai opened this issue · comments
The official way to use Autoprefixer is by postcss-loader
:
Thanks. I'm a little unclear what exactly postCSS does better than just compiling Sass and subsequently auto-prefixing it. My implementation seems to work but if you have experience with postCSS and/or it is the "correct" way, feel free to submit a PR!
PostCSS is not a Sass replament.
It is a basement for any CSS transformation by JS plugins. Autoprefixer is just a PostCSS plugin.
There is a plugins for Sass-like syntax. But they are just small and non-important part. CSS Modules, cssnext polyfills, cssnano minifier, stylelint linter are much more interesting.
But this issue is not about replament Sass with PostCSS. It is about correct way to load Autoprefixer. Autoprefixer is just a PostCSS plugin. So autoprefixer-loader
contains PostCSS too. But official way is to use postcss-loader
to make updates faster. Also when user will think about adding some other PostCSS plugin, with postcss-loader
he/she will have better perfomance.
Cool, thanks Andrey. I updated it, seems to work, but please have a look and let me know if anything is off: https://github.com/pmdesgn/elm-webpack-starter/blob/master/webpack.config.js#L70-L77
Awesome :)