Skip to content

browserslist config ignored #283

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

Closed
dmiller9911 opened this issue Jun 3, 2016 · 3 comments
Closed

browserslist config ignored #283

dmiller9911 opened this issue Jun 3, 2016 · 3 comments

Comments

@dmiller9911
Copy link

If minimize is enabled and a browserslist config is present, the config is ignored. It looks to be ignored due to the from that is being sent to postcss.

pipeline.process(inputSource, {
    // we need a prefix to avoid path rewriting of PostCSS
    from: "/css-loader!" + options.from,
    to: options.to,
    ...
})

When "/css-loader!" is prefixed to the from field the path sent to postcss, and eventually browserslist ends up being something like:

c:\\css-loader!c:\\src\\app\\something.css

browserslist splits on path.sep, so the only valid directory it will get is c:\

The only workaround right now is to either disable autoprefixer or place a browserslist config file at the root of the machine.

@chrisforrette
Copy link

I had this same issue, though I don't understand the internals of Webpack enough to understand where things are falling through the cracks. I was able to get it working by manually setting an environment variable in my webpack.config.js like so: process.env.BROWSERSLIST = 'Last 3 versions';. You could also use the BROWSERSLIST_CONFIG env variable, setting it to a file path if your browser support is more complex than a one-liner. Here's the docs I referenced: https://github.com/ai/browserslist#config-file

@necolas
Copy link

necolas commented Aug 25, 2016

I wasn't expecting this plugin to strip our vendor prefixes either. I'd prefer to see that automatic functionality removed because it's very confusing.

@SpaceK33z
Copy link
Contributor

The automatic stripping of vendor prefixes has been disabled (#281), so this issue is no longer relevant.

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

4 participants