Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cssnano conflicts with autoprefixer #938

Open
beldevel opened this issue May 21, 2017 · 1 comment
Open

cssnano conflicts with autoprefixer #938

beldevel opened this issue May 21, 2017 · 1 comment

Comments

@beldevel
Copy link

beldevel commented May 21, 2017

If we leave cssnano plugin as is, it will use it's own autoprefixer plugin which:

Removes unnecessary prefixes based on the browsers option. Note that by default, it will not add new prefixes to the CSS file. link

So, the autoprefixer which is used before cssnano comes out with distorted output.
In my case I needed display: -webkit-flex for older safari browsers but cssnano was just droppping it.
Disabling cssnano's autoprefixer fixes this issue: $.cssnano({ autoprefixer: false })

@bermanboris
Copy link

I'm experiencing this problem as well.

@beldevel solution solves the problem. Not sure if that's the correct way though.

gulpfile.babel.js

replace:
.pipe($.if('*.css', $.cssnano()))

with:
.pipe($.if('*.css', $.cssnano({autoprefixer: false})))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants