Skip to content

Commit 4106750

Browse files
committedJun 4, 2024·
build: improve chunk names
1 parent ca2282b commit 4106750

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

Diff for: ‎build.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineBuildConfig } from "unbuild";
22
import { resolve } from "pathe";
33
import { fileURLToPath } from "node:url";
4+
import { normalize } from "pathe";
45

56
const srcDir = fileURLToPath(new URL("src", import.meta.url));
67

@@ -56,4 +57,15 @@ export default defineBuildConfig({
5657
"firebase-functions",
5758
"@scalar/api-reference",
5859
],
60+
rollup: {
61+
output: {
62+
chunkFileNames(chunk) {
63+
const id = normalize(chunk.moduleIds.at(-1));
64+
if (id.includes("/src/cli/")) {
65+
return "cli/[name].mjs";
66+
}
67+
return "_chunks/[name].mjs";
68+
},
69+
},
70+
},
5971
});

0 commit comments

Comments
 (0)
Please sign in to comment.