You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see the .test-2 is missing in the built output, this is caused by the load hook (ctx.utils.generateCSS('base')) is ran before transform (transformCSS(code, id)). So although transformCSS added the test-2 to base layer, the generating produre has run before and wont generate again, so we got no test-2 in the output.
Describe the bug
Input App.vue:
Output:
You can see the
.test-2
is missing in the built output, this is caused by theload
hook (ctx.utils.generateCSS('base')
) is ran beforetransform
(transformCSS(code, id)
). So althoughtransformCSS
added thetest-2
to base layer, the generating produre has run before and wont generate again, so we got notest-2
in the output.Minimal Reproductions
https://github.com/upupming/windicss-missig-layer-build-time#bug-2----build-time-layer-missing
Versions
Additonal Context
I believe the root cause is that we can send the updated layer to the browser by ViteDevServer & send HMR in dev mode like this:
vite-plugin-windicss/packages/vite-plugin-windicss/src/index.ts
Lines 151 to 154 in fda2347
vite-plugin-windicss/packages/vite-plugin-windicss/src/modules.ts
Lines 45 to 52 in fda2347
But in build time, we cannot rely on this feature anymore, what do you think?
The text was updated successfully, but these errors were encountered: