Skip to content

Commit b085a48

Browse files
committed
build: fix chunks
1 parent 5325b20 commit b085a48

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

build.config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,20 @@ export default defineBuildConfig({
8383
);
8484
},
8585
rolldownOutput(config) {
86-
config.advancedChunks!.includeDependenciesRecursively = false;
86+
// config.advancedChunks!.includeDependenciesRecursively = false;
8787
config.advancedChunks!.groups?.unshift(
88-
{ test: /src\/build\/rollup/, name: "_build/rollup" },
89-
{ test: /src\/build\/rolldown/, name: "_build/rolldown" }
88+
{
89+
test: /src\/build\/(plugins|virtual|\w+\.ts)/,
90+
name: "_build/common",
91+
},
92+
{ test: /src\/(utils)\//, name: "_chunks/utils" }
9093
);
9194
config.chunkFileNames = (chunk) => {
9295
if (chunk.name.startsWith("_")) {
9396
return `[name].mjs`;
9497
}
9598
if (chunk.name === "rolldown-runtime") {
96-
return `_rolldown.mjs`;
99+
return `_common.mjs`;
97100
}
98101
if (chunk.name.startsWith("libs/")) {
99102
return `_[name].mjs`;
@@ -130,9 +133,9 @@ export default defineBuildConfig({
130133
if (
131134
chunk.moduleIds.every((id) => /src\/(runner|dev|runtime)/.test(id))
132135
) {
133-
return `_dev.mjs`;
136+
return `_chunks/dev.mjs`;
134137
}
135-
return "_nitro.mjs";
138+
return "_chunks/nitro.mjs";
136139
};
137140
},
138141
async end() {

0 commit comments

Comments
 (0)