-
Notifications
You must be signed in to change notification settings - Fork 27
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
vite: run transform as early as possible #94
base: master
Are you sure you want to change the base?
Conversation
@nonzzz Do you want to weigh in on this? |
This is conceptually correct because style9 has to have been converted at bundle time. This fixes Qwik bundling, for example.
@johanholmerin ok.I will take a look |
I must add that this is not quite the full solution for Qwik, because of the chunk processing and some weirdness around dev mode. To make style9 work in Qwik, you need:
Reasons:
|
Sorry. I'm |
Hmm - here's a blitz using the unchanged module: https://stackblitz.com/edit/qwik-style9?file=src%2Froutes%2Findex.tsx This almost works out of the box because I have the definition inside Dev mode works as well, after the first re-render of the component. The reason is that the name of the css import is wrong the first time, and on re-render it imports the css with the correct name. So this means that the As for the renderChunks, it would be nice if it's optional so there's not two CSS files that are imported. You can see this happening by running (Qwik automatically inlines CSS that is less than 10KB) |
@wmertens |
@nonzzz I don't understand, every time style9 CSS is encountered the virtual .css file is invalidated, so it will contain eventually all the css, no? I don't see extra build steps in renderChunks? I'm still trying to figure out how the qwik vite plugin works in build mode. The files are split up before the style9 transform runs, and ideally style9 runs before qwik parses the files. |
@wmertens It looks like we create many javascript file and define When rollup run. The CSS code splitting is a function provided by vite. Currently. we remove the virutal module in |
This is conceptually correct because style9 has to have been converted at bundle time. This fixes Qwik bundling, for example.