Skip to content

Commit 7e2df92

Browse files
committed
Fix the Split Chunk functionality + typescript supported version
1 parent 2a891f8 commit 7e2df92

File tree

3 files changed

+61
-53
lines changed

3 files changed

+61
-53
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"rimraf": "5.0.5",
9696
"ts-node": "10.9.2",
9797
"ts-prune": "0.10.3",
98-
"typescript": "5.4.5",
98+
"typescript": "5.3.3",
9999
"vite": "5.2.10",
100100
"vite-plugin-checker": "0.6.4",
101101
"vite-plugin-ejs": "1.7.0",

frontend/pnpm-lock.yaml

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/vite.config.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
defineConfig,
3-
loadEnv,
4-
UserConfigExport,
5-
splitVendorChunkPlugin,
6-
} from 'vite';
1+
import { defineConfig, loadEnv, UserConfigExport } from 'vite';
72
import react from '@vitejs/plugin-react-swc';
83
import tsconfigPaths from 'vite-tsconfig-paths';
94
import { ViteEjsPlugin } from 'vite-plugin-ejs';
@@ -22,7 +17,7 @@ export default defineConfig(({ mode }) => {
2217
}),
2318
];
2419

25-
const prodPlugins = [...defaultPlugins, splitVendorChunkPlugin()];
20+
const prodPlugins = [...defaultPlugins];
2621

2722
const devPlugins = [
2823
...defaultPlugins,
@@ -42,8 +37,21 @@ export default defineConfig(({ mode }) => {
4237
outDir: 'build',
4338
rollupOptions: {
4439
output: {
45-
manualChunks: {
46-
ace: ['ace-builds', 'react-ace'],
40+
manualChunks(id: string) {
41+
if (id.includes('ace-builds') || id.includes('react-ace')) {
42+
return 'ace';
43+
}
44+
45+
// creating a chunk to react routes deps. Reducing the vendor chunk size
46+
if (
47+
id.includes('react-router-dom') ||
48+
id.includes('@remix-run') ||
49+
id.includes('react-router')
50+
) {
51+
return '@react-router';
52+
}
53+
54+
return null;
4755
},
4856
},
4957
},

0 commit comments

Comments
 (0)