Using plugin "webpack.optimize.UglifyJsPlugin" led to remove the style "display: -webkit-flex;"
See original GitHub issueThank you to review the issue.
I using this plugin to compress js and css. I found an issue. It will remove the style “display: -webkit-flex;”.
The css file
.product-grid {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: wrap;
flex-wrap: wrap;
-ms-flex-line-pack: center;
-webkit-align-content: center;
align-content: center;
}
after webpack builded, the css will become
.product-grid {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
display: -webkit-flex;
-webkit-flex-flow: wrap;
flex-wrap: wrap;
-ms-flex-line-pack: center;
align-content: center
}
The result is it remove “display: -webkit-flex;”.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:15 (1 by maintainers)
Top Results From Across the Web
webpack.optimize.UglifyJsPlugin has been removed
I have tried adding the minimizer within Module exports in my webpack.config.prod.js file, as well as installing 'uglifyjs-webpack-plugin' ...
Read more >Flexbox prefix not being compiled - sage - Roots Discourse
A bit of a strange one - when compiling for production a specific flexbox prefix: -webkit-flex seems to be being ignored.
Read more >UglifyjsWebpackPlugin | webpack
This plugin uses uglify-js to minify your JavaScript. Requirements. This module requires a minimum of Node v6.9.0 and Webpack v4.0.0. Getting Started.
Read more >v4.5.10 Release Notes | Documentation - ServiceStack Docs
In production builds, .css files are written using ExtractTextPlugin and the resulting .js files minified with UglifyJS. The CopyWebpackPlugin is then used ...
Read more >解决webpack编译后导致-webkit-box被强制去除了的问题
issue3: # Using plugin “webpack.optimize.UglifyJsPlugin” led to remove the style “display: -webkit-flex;. 觉得略坑。还是花了大概一下午看这个问题 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I need to strike my last post. When I upgraded from node 5 to node 6, I had to reinstall all of my node_modules, and I think it messed up my post-css autoprefixer config for
{browsers: []}
. So properly configuring that fixed most of the autoprefixing, except when running through UglifyJS webpack plugin.I finally wrapped my head around the problem, though, and now I understand that when you use UglifyJSPlugin, it is only used to optimized the JS (of course), BUT simultaneously, using that plugin enables the minimize parameter on css-loader. This in turn enables cssnano in css-loader which has autoprefixing enabled by default. This autoprefixer overrides any postcss autoprifixer, and does not inherit the proper
{browsers: []}
configuration. So it doesn’t prefix properly. To disable the autoprefixer in css-loader and allow postcss to take over, you will need to add-autprefixer
to the loader parameters. See this issue in postcss/autoprefixer for more info https://github.com/postcss/autoprefixer/issues/660Are you sure this is related to UglifyJsPlugin. I mean, it is Uglify
Js
Plugin 😄I had a similar problem where I was using cssnano as a PostCSS process. It turns out it aggressively removes things it shouldn’t. This is how I fixed it: