Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions patches/@unocss__vite@66.10.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/dist/index.mjs b/dist/index.mjs
index 05707c19602a9bedee967d2520efd5dd9b5b71a5..702d7859f2c7aeefc9f00cae20c11f67583c2847 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -571,6 +571,15 @@ function GlobalModeBuildPlugin(ctx) {
if (!isAbsolute(dir)) distDirs.push(resolve(config.root, dir));
});
}
+ // Vite 8's Environment API gives each build environment its own
+ // `build.outDir`, which differs from the top-level one used above
+ // (e.g. Nuxt builds the client into `.output/public`). `renderChunk`
+ // keys the css-post lookup by the *environment* output dir, so
+ // register those too — otherwise generated utility CSS is silently
+ // dropped from the bundle.
+ for (const env of Object.values(config.environments ?? {})) {
+ if (env?.build?.outDir) distDirs.push(resolve(config.root, env.build.outDir));
+ }
const cssPostPlugin = config.plugins.find((i) => i.name === "vite:css-post");
const cssPlugin = config.plugins.find((i) => i.name === "vite:css");
if (cssPostPlugin) distDirs.forEach((dir) => cssPostPlugins.set(dir, cssPostPlugin));
Loading
Loading