Closed nonzzz closed 7 months ago
BTW, I think we can speed up processing a little bit by checking if the code contains style9
before running babel on it
@wmertens I don't understand you mean. Should we need check it in transform
?
Yes correct, if style9 isn't mentioned there's no point in generating an AST
OK. I will try it
And for the css plugin, maybe it's better to throw if the plugin isn't there?
@wmertens No. vite already includes these 2 plugins. This is also done in other similar libraries
What I'm worried about is that the plugin only works if those two plugins are present, so IMHO either it should throw or it shouldn't test for them
Qwik is base on vite
and vite contains vite:css
and vite:css-post
plugin. I will test Qwik in my local env.
You can look at vite-css and vite-plugin If vite don't provide those plugin will panic
@nonzzz when I add this as the first line of transformStyle9
:
if (!/style9/.test(code)) return;
then the time spent goes from:
to:
@nonzzz when I add this as the first line of
transformStyle9
:if (!/style9/.test(code)) return;
then the time spent goes from:
to:
cool.
I can confirm that this change fixes the extra CSS file in Qwik for building, yey :-)
In dev mode the style doesn't work, even after changing the file (which used to work because the hot reload had the correct css module path). Trying to find out why - it looks to be reloading the page instead of hot reloading.
I'm pretty sure this is a problem with Qwik though, so it shouldn't block this PR. Changing the ordering doesn't make a difference.
Linked Issues
94
Description
This pull request won't need option
fileName
. PerfrenderChunk
logic so that it can work better with vite.