-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Not getting autoprefixer to work with extract-text-webpack-plugin #81
Comments
Seems like it is problem of css-loader CSS minifier. Please check Autoprefixer FAQ for details (sorry I am in the train in the middle of Kazakhstan) - you should move browser requirements to Also |
I'm not sure what you mean :) And yes, thats just a test config with the last 10 browsers so that I can see if it's working or not. |
Please check Autoprefixer FAQ section in Autoprefixer README. It contains question "No prefixes in production", answer will contain explanation and solution. Sorry, I can't give you a direct link. |
Ahh, now I see. Thanks! |
@badtant You should disable the |
@badtant - would love to see an example of your final working config |
Webpack fixed a Autoprefixer issue, so we could just remove this section! |
@donpinkus right now: |
@hugojing please write This is very important |
Tried everything but still nothing. :
postcss.config.js
package.json
No change, it doesn't add prefixes.... |
Just for getting started, but could you please use try using webpack 2 loader syntax inside webpack.config.js ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options : { autoprefixer: false, sourceMap: true, importLoaders: 1 }
},
'postcss-loader'
]
}) postcss.config.js plugins: [
- require('autoprefixer')
+ require('autoprefixer')()
] |
@michael-ciniawsky it worked, thanks. 👍 |
@michael-ciniawsky is there a way to disappear that postcss.config.js and push it into the webpack.config.js file? sorry to abuse you on this one 👴 |
webpack.config.js ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: { importLoaders: 1 }
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [ require('autoprefixer')({...options}) ]
}
}
]
}) |
👍 |
I find the real reason of no prefix, it's not the problem of new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
safe: true,
autoprefixer: { disable: true },
discardComments: {
removeAll: true
}
}
}); the option of also see the issue optimize-css-assets-webpack-plugin/issues/51 maybe some brother need this so I copy and attach this although this issue closed a long time ago. |
Hi,
I have a working dev config for my scss like this:
Now I wanted to extract the css to a file when I build for production. I get a file with the config below. The problem is that the options for postcss (for instance autoprefixer) doesn't get applied.
Can anyone see what I'm doing wrong?
Thanks
The text was updated successfully, but these errors were encountered: