Skip to content

Commit 0f8e4fd

Browse files
committed
Revert "Reapply "fix: remove manualChunks configuration from build options in vite.config.ts""
This reverts commit 07514cb. AdminForth/1978/background-job-deleting-a-runn
1 parent aa9d813 commit 0f8e4fd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎adminforth/spa/vite.config.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,22 @@ export default defineConfig({
3737
'@': fileURLToPath(new URL('./src', import.meta.url)),
3838
'@@': fileURLToPath(new URL('./src/custom', import.meta.url)),
3939
}
40-
},
40+
},
41+
build: {
42+
rollupOptions: {
43+
output: {
44+
manualChunks(id) {
45+
// reduce the size of the vendor chunk
46+
// to only include the package name
47+
// helps to reduce consumption of memory
48+
if (id.includes('node_modules/')) {
49+
// take the last node_modules segment: pnpm nests packages as node_modules/.pnpm/<pkg>@<version>/node_modules/<pkg>
50+
return id.split('node_modules/').pop()!.split('/')[0];
51+
}
52+
},
53+
},
54+
},
55+
},
4156
css: {
4257
preprocessorOptions: {
4358
scss: {

0 commit comments

Comments
 (0)