You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autoprefixer not working for serving prod builds #3156
@filipesilva, So it looks like webpack-merge doesn't handle merging LoaderOptionsPlugin. postcss is configured via the plugin in both the common webpack config and the production config.
The conflict here is between my PR #2593 and #2852.
Both creates a new instance of webpack.LoaderOptionsPlugin in the plugins array. A quickfix for now would be to simply move postcss-discard-comments into common and doing that in dev aswell. I placed it in prod only to save CPU cycles while working in dev tho.
I don't think there is any webpack plugin for merging that type of config.
I manually patch webpack-build-production.js in order to have autoprefxing on production build. I also had to add some extra params on autoprefixer because I needed to give support to Safari 7:
postcss: [autoprefixer({ browsers: ['> 1%', 'last 2 versions', 'Safari 7'] })].
I suggest to add a new setting on angular-cli.json in order to be able to change it, also we should be able to don't prefix anything if the project requeriments are just for the latest browser versions.
Activity
clydin commentedon Nov 16, 2016
@filipesilva, So it looks like
webpack-mergedoesn't handle mergingLoaderOptionsPlugin.postcssis configured via the plugin in both the common webpack config and the production config.grizzm0 commentedon Nov 16, 2016
The conflict here is between my PR #2593 and #2852.
Both creates a new instance of webpack.LoaderOptionsPlugin in the plugins array. A quickfix for now would be to simply move postcss-discard-comments into common and doing that in dev aswell. I placed it in prod only to save CPU cycles while working in dev tho.
I don't think there is any webpack plugin for merging that type of config.
oriolcp commentedon Dec 2, 2016
I manually patch webpack-build-production.js in order to have autoprefxing on production build. I also had to add some extra params on autoprefixer because I needed to give support to Safari 7:
postcss: [autoprefixer({ browsers: ['> 1%', 'last 2 versions', 'Safari 7'] })].
I suggest to add a new setting on angular-cli.json in order to be able to change it, also we should be able to don't prefix anything if the project requeriments are just for the latest browser versions.
miniplus commentedon Dec 2, 2016
@oriolcp In order to specify browser needs concerning this, you can do all of this using a browserslist file (https://github.com/ai/browserslist).
No need to make any changes in the core this way
oriolcp commentedon Dec 2, 2016
Thanks a lot I didn't know about browserslist file.
fix(build): added autoprefixer to prod
fix(build): added autoprefixer to prod
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(build): added autoprefixer to prod