Skip to content

Commit 0f1c32e

Browse files
refactor: simplify manualChunks function in vite.config.ts
1 parent f6f3320 commit 0f1c32e

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/core/vite.config.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,12 @@ export default defineConfig({
5757
...Object.keys(pkg.peerDependencies ?? {}),
5858
],
5959
output: {
60-
manualChunks(id) {
61-
if (id.includes('node_modules')) {
62-
// vendor kodlarını gruplayalım
63-
return 'vendor'
64-
}
65-
// src altındaki ana klasörleri ayrı chunk'lara bölelim
66-
const match = id.match(/[/\\]src[/\\](.*?)[/\\]/)
67-
if (match && match[1]) {
68-
return match[1]
69-
}
60+
manualChunks: (id) => {
61+
const chunks = id.match(/[/\\]src[/\\](.*?)[/\\]/)
62+
return chunks ? chunks[1] : null
7063
},
7164
exports: 'named',
7265
chunkFileNames: '[name].mjs',
73-
hoistTransitiveImports: true,
7466
minifyInternalExports: true,
7567
},
7668
},

0 commit comments

Comments
 (0)