-
Notifications
You must be signed in to change notification settings - Fork 22
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
Options to split by rules instead of size? #16
Comments
I recently forked this project and added the ability split CSS files by comment. It works similarly to webpack magic comments. When I have time, I'll see about adding support for media queries. However, you could simulate the behavior using the current version. For example: /*! split:ie8 */
.box-shadow {
...
}
/*! split:ie9 */
.flexbox-row {
...
}
/*! split:mobile */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
.mobile {
...
}
} Will be split into three separate chunks with the names denoted in the comment: I tested out every other CSS splitting plugin I could find and none of them seemed to offer this somewhat obvious feature. The main motivation being to split vendor styles (compiled from SASS) from app-specific styles. https://github.com/jeremiahmmartinez/css-magic-split-webpack-plugin |
Almost half a year later and there still doesn't seem to be a webpack plugin for this :( @jeremiahmmartinez you haven't found another solution than your fork, have you? I did try it but the problem with your feature is
I've found some promising postcss plugins such as css-mqpacker which lets me concat my media queries. UPDATE In case someone is reading this: I've created an own webpack plugin for extracting media queries from a css chunk |
There may be quite a few rules only used in certain circumstances. (eg. IE X specific rules, media queries etc.). They shouldn't be split by size but rules. Is it possible or any other ways to achieve this?
The text was updated successfully, but these errors were encountered: