Css-loader: Remove Autoprefixer from cssnano

Created on 27 May 2016  路  17Comments  路  Source: webpack-contrib/css-loader

css-loader contains cssnano to compress CSS. cssnano by default contains Autoprefixer to remove all prefixes. It works great when you undertand what you want to do. But because css minifier feature is hidden inside webpack many people don鈥檛 expect that webpack will remove prefixes.

Right now I have so many issues in Autoprefixer repo about this issue.

So I suggest to remove autoprefixer rule from cssnano in css-loader.

@ben-eb do you agree as cssnano author?

@sokra we have problem right now, because in latest Can I Use update iOS 8 was removed from default last 2 versions browsers list and many people are in pain.

Most helpful comment

@sokra do you need PR for it? (It is just one small option).

All 17 comments

Of course, there is a much better way. Put browserslist config to project root, so every tool will use same browsers (Autoprefixer, cssnano, doiuse, cssnext). But many people don鈥檛 know about it.

I posted a tweet about this solution. But your know, people don鈥檛 read a docs.

I added this question to Autoprefixer FAQ, but I still think that we should fix it in css-loader too

Sure, if it is causing confusion. 馃憤

I plan to remove this option anyway for version 4 but it's a while away.

@ai I am curious if the browserslist still works. I created one, and it seems to be ignored. After doing some digging I found that the path being sent to browserslist is something along the lines of:

c:css-loader!c:src\node_modules\postcss-loader\index.js!c:src\node_modules\less-loader\index.js!c:src\foo.less

The c:css-loader seems to be coming from here

The problem with this is that browserslist will tick down each dir until it finds the config file, but with this path it will never find one unless it is sitting in c:.

loader config below:

{ loader: 'style!css!postcss!less', test: /.less$/ }

@dmiller9911 it is a bad place for other issue :). Could you:

  1. Check that you use latest version of postcss-loader (I fixed path issue in previous release)
  2. Create a issue in postcss-loader if you still have a issue.

Second this removal. I highly prefer single responsibility packages used as peers. Lessons from the grunt do everything for everyone days.

@sokra do you need PR for it? (It is just one small option).

@sokra ping

@sokra could you say anything? :) It is very sad to have no feedback.

This issue is very important for me, because users write me about it.

@ai, sokra has limited time atm since he has holidays. I agree with you here. I can push the fix, but since I don't maintain css-loader (do have permissions though) I want to get feedback from at least one other member of the core team.

Still waiting for release 馃槈.

Users still report a issue and I need to spend time to explain problem
https://github.com/postcss/postcss-loader/issues/134

Other example of issue, where we spend time, because this issue is not released https://github.com/postcss/postcss-loader/issues/81

@SpaceK33z please, write anything about this issue. It is very painful when everyone just ignore you :(.

The new issue in Autoprefixer about this issue: https://github.com/postcss/autoprefixer/issues/747

Please release it. I know that open source developers always don鈥檛 have time. But right now I spend my time, because of this issue.

@ai, I'm really sorry. I didn't have npm publish permissions and it took me a while to get them. I have them now and I'll release a new version today.

@ai, published 0.26.0. Sorry again, I fully understand your frustrations about how we handled this.

Thanks! 馃槉

Was this page helpful?
0 / 5 - 0 ratings