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
Chunk css is inserted before bundle on production, inconsistent with dev environment #1106
Comments
I’ll transfer this issue to preact-cli |
Thanks! The reason stylesheet order matters is that it's a tie-breaker in case multiple selectors with the same specificity affect the same properties of the same element. Stylesheets coming later overpower the ones coming earlier. Right now i'm seeing different visual results between production and development. |
Ah this makes sense. We need to adjust where we are injecting the prerendered chunks. Maybe we could just set
|
@developit I tried
but this didn't seem to do anything |
I posted an update here: May be for now we can just make them consistent? would that help? |
Yeah that would certainly help for me. If possible, that chunks should be inserted after the bundle. |
I personally don't mind either all of them will be in head, or all of them be in body. thank you |
This is actually caused by Critters: it inlines your critical CSS into a style tag in Critters has a One note: the production output ordering is more intentional here than development ordering. During development there's no prerendering and CSS is injected dynamically, so the ordering is inconsistent. |
@developit do you think our currrent choice of |
I avoided swap as the default here because it requires JavaScript, but I think 100% of CLI apps would fail without JS enabled anyway.. |
makes sense, also this will make everything a lot more intuitive i agree |
Steps to reproduce
Expected Behavior
In production environment, I expect both csses to be in the same order as in dev environment - chunk after bundle.
Actual Behavior
<style>
element of the chunk will be injected after the bundle css<link>
element of the chunk will be inserted before the bundle css (chunk in head, bundle before</body>
)Conversation in Slack with prateekbh
The text was updated successfully, but these errors were encountered: