Skip to content

Commit 6b6faa5

Browse files
committed
Update vite.config.ts
1 parent f73d7f5 commit 6b6faa5

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"start": "yarn prepareLaunch && yarn launch",
1111
"start:package": "cross-env VITE_JRE_SOURCE=package yarn prepareLaunch && VITE_JRE_SOURCE=package yarn launch",
1212
"dev": "cross-env VITE_JRE_SOURCE=local yarn prepareLaunch && VITE_JRE_SOURCE=local yarn launch",
13+
"prebuild": "yarn lint",
1314
"build": "node src/imports/swapImport.mjs && tsc -b && vite build",
1415
"build-local": "yarn build --base=/",
1516
"predeploy": "yarn build",

demo/vite.config.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,36 @@ export default defineConfig({
2323
build: {
2424
outDir: 'build',
2525
emptyOutDir: true,
26+
rollupOptions: {
27+
output: {
28+
manualChunks: {
29+
// UI library chunks
30+
chakra: [
31+
'@chakra-ui/react',
32+
'@chakra-ui/icons',
33+
'@emotion/react',
34+
'@emotion/styled',
35+
'framer-motion',
36+
],
37+
// Code editor and related packages
38+
codemirror: [
39+
'@uiw/react-codemirror',
40+
'@codemirror/lang-json',
41+
'@uiw/codemirror-theme-github',
42+
'@uiw/codemirror-theme-console',
43+
'@uiw/codemirror-theme-quietlight',
44+
'@uiw/codemirror-theme-monokai',
45+
],
46+
// Icons library
47+
icons: ['react-icons/fa', 'react-icons/bi', 'react-icons/ai'],
48+
// Core React packages
49+
vendor: ['react', 'react-dom', 'wouter', 'use-undo'],
50+
// JSON utilities
51+
json: ['json5', 'ajv'],
52+
},
53+
},
54+
},
55+
chunkSizeWarningLimit: 800,
2656
},
2757
define: {
2858
__BUILD_TIME__: JSON.stringify(

0 commit comments

Comments
 (0)