postcss / postcss-nested

PostCSS plugin to unwrap nested rules like how Sass does it.
MIT License
1.15k stars 66 forks source link

Browser support #71

Closed ZeeCoder closed 6 years ago

ZeeCoder commented 6 years ago

While technically this module runs in modern browsers, making a production build fails if minification expects es5 code.

This is due to the fact that the project's postcss-selector-parser dependency has the dot-prop dependency, which is written in es6. (It uses const for example)

This is basically the same issue I had with autoprefixer: I think this should work in browsers and we should be able to bundle it as expected, but due to the transitive es6 dependency it's not currently possible.

Question is: Would you consider supporting browsers?

If yes, then we'd have to either come up with a replacement for dot-prop, or update that package as well, to export es5 code.

ai commented 6 years ago

This code should work in browser. Since it is written on ES5. For parser you need to ask their repo.

ZeeCoder commented 6 years ago

I will, but I'll leave this issue open too then, of that's alright? since it won't work in browser until the dependencies are fixed.

ai commented 6 years ago

I am not big fun dublicate issue, but let's keep it off your want

ZeeCoder commented 6 years ago

Thanks, helps me keep track of things. 👍

ZeeCoder commented 6 years ago

@ai Just for the record: I have an open PR on postcss-selector-parser that's due to be merged in soon. It should be a patch release, so right after I'll test postcss-nested to see if it works, and if so, I'll close this issue.

👍

ZeeCoder commented 6 years ago

@ai We can close this if you want, I don't really have time to address the issue, especially since it doesn't seem like it's a focus for postcss-selector-parser's maintainers.