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

Properties lost with UglifyJsPlugin after upgrading to 0.15.5 #114

Closed
gpbl opened this issue Jul 21, 2015 · 3 comments
Closed

Properties lost with UglifyJsPlugin after upgrading to 0.15.5 #114

gpbl opened this issue Jul 21, 2015 · 3 comments

Comments

@gpbl
Copy link

gpbl commented Jul 21, 2015

I upgraded from 0.14.5 to 0.15.5 and I've found some parts of my styles not working correctly. Trying to isolate the problem, I've seen for example that this source:

.Swipe {
  position: relative;
  user-select: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.Swipe-container {
  overflow: hidden;
  visibility: hidden;
  position: relative;
}

.Swipe-wrapper {
  overflow: hidden;
  position: relative;
}

.Swipe-child {
  float: left;
  width: 100%;
  position: relative;
}

...after being auto-prefixed, get minified as

.Swipe {
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%
}

.Swipe-container {
    visibility: hidden
}

.Swipe-container,.Swipe-wrapper {
    overflow: hidden;
    position: relative
}

.Swipe-child {
    float: left;
    width: 100%
}
/*# sourceMappingURL=main-131e2e34531d647cdb93.css.map*/

(the minified version has been re-indented with chrome dev tools)

Note how the .Swipe-child selector has lost its position: relative. The property stays if I remove .Swipe-container,.Swipe-wrapper block.

Does anybody else have this kind of issues? Maybe it is related to #89 and #94.

@EvHaus
Copy link

EvHaus commented Jul 29, 2015

I'm having the same problem. A bunch of CSS attributes are getting stripped out when running through Uglify. I'm using css?-restructuring as the loader, so I'm expecting no restructuring to occur, but that option seems to be ignored in 0.15.x.

@EvHaus
Copy link

EvHaus commented Jul 29, 2015

According to this issue: clean-css/clean-css#318 the solution is to disable aggressive merging, but I cannot for the life of me figure out how to do this in css-loader. I've tried all of these, but none of them seem to work:

loader: 'style!css?-restructuring&aggressiveMerging'
loader: 'style!css?-restructuring&-aggressiveMerging'
loader: 'style!css?-restructuring&noAggressiveMerging'
loader: 'style!css?-restructuring&-noAggressiveMerging'
loader: 'style!css?-restructuring&skip-aggressive-merging'
loader: 'style!css?-restructuring&-skip-aggressive-merging'

The option definition is webpack is definitely confusing. I have no idea why it's not working and I have no way to check which options are enabled.

@SpaceK33z
Copy link
Contributor

This has been fixed in webpack v2. Also see webpack/webpack#666.

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

3 participants