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

4095 rules or selectors? #26

Open
mygaochunming opened this issue Nov 29, 2017 · 4 comments
Open

4095 rules or selectors? #26

mygaochunming opened this issue Nov 29, 2017 · 4 comments

Comments

@mygaochunming
Copy link

@izaakschroeder thanks for your work.
But IE's limit is not 4095 selectors?
An article about IE limits

Though it says 4095 rules in the article, but I have see some comments in the article said the limit maybe 4095 selectors, and I have test it myself. I think 4095 selectors maybe right.

@izaakschroeder
Copy link
Contributor

Hey @mygaochunming 😄 Is this a bug you're raising here or just a question? From my understanding you're right the limit is 4095 selectors. You can see here in the discussion: https://stackoverflow.com/questions/9906794/internet-explorers-css-rules-limits. You're free to test for yourself of course.

@mygaochunming
Copy link
Author

@izaakschroeder Thanks. I have seen this in the readme

size: default: 4000 The maximum number of CSS rules allowed in a single file. To make things work with IE this value should be somewhere around 4000.

The size is related to CSS rules.

I don't known which size should I set when I use the plugin, because if I set to 4000 (rules), the count of the selectors maybe break the limit.

Now I used 3500 rules size in my project, I hope it will not break the limit. But if I can set the size to 4095 selectors, I can have a good sleep every day, do not need to worry about it will break the limit in my project.

This is not a bug, maybe a new feature.

@izaakschroeder
Copy link
Contributor

I guess I should adjust the README.md file. The code actually does use selector count and not rule count. You can see here: https://github.com/metalabdesign/css-split-webpack-plugin/blob/master/src/chunk.js#L10 😄

@mygaochunming
Copy link
Author

@izaakschroeder Thanks.

Before going to sleep, I have another question:

defer: default: 'false'. You can pass true here to cause this plugin to split the CSS on the emit phase. Sometimes this is needed if you have other plugins that operate on the CSS also in the emit phase. Unfortunately by doing this you potentially lose chunk linking and source maps. Use only when necessary.

Assume there is a plugin B which operate on the css in the emit phase.

If B change the count of the selectors or other limit options, it maybe break the limit.

But if B do not change any of the limit options, then it does not matter.

Am I right?

Though set defer to true, the plugins executed asynchronously, it also can't ensure this plugin executed after the other plugins.

Am I right?

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

2 participants