Skip to content

Commit 07c118d

Browse files
pi0Copilot
andcommitted
build: simplify chunk names
Co-authored-by: Copilot <copilot@github.com>
1 parent 40bddff commit 07c118d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

build.config.mjs renamed to build.config.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export default defineBuildConfig({
1414
hooks: {
1515
rolldownOutput(config) {
1616
config.codeSplitting = {};
17-
config.chunkFileNames = "h3-[hash].mjs";
17+
config.chunkFileNames = (chunkInfo) => {
18+
if (chunkInfo.name === "src") {
19+
return "h3.mjs";
20+
}
21+
return "[name].mjs";
22+
};
1823
},
1924
async end() {
2025
const { exportSource } = await import("mdzilla");
@@ -26,8 +31,9 @@ export default defineBuildConfig({
2631
rolldownConfig(config) {
2732
config.experimental ??= {};
2833
config.experimental.attachDebugInfo = "none";
29-
30-
config.plugins ??= [];
34+
if (!Array.isArray(config.plugins)) {
35+
config.plugins = [];
36+
}
3137
config.plugins.push({
3238
name: "remove-comments",
3339
renderChunk(code) {

0 commit comments

Comments
 (0)