Skip to content

Commit c4963ee

Browse files
committed
feat: add support for manual chunking
1 parent bd6ecae commit c4963ee

File tree

3 files changed

+72
-29
lines changed

3 files changed

+72
-29
lines changed

package-lock.json

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

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.1.6",
3+
"version": "1.1.6-beta-2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -60,11 +60,8 @@
6060
"husky": "^7.0.4",
6161
"lint-staged": "^12.5.0",
6262
"moment": "^2.29.4",
63-
"monaco-editor": "0.44.0",
64-
"monaco-yaml": "5.1.1",
6563
"prettier": "^3.1.1",
6664
"react-ga4": "^1.4.1",
67-
"react-mde": "^11.5.0",
6865
"react-toastify": "9.1.3",
6966
"typescript": "5.5.4",
7067
"vite": "5.4.11",
@@ -79,11 +76,14 @@
7976
"@rjsf/validator-ajv8": "^5.13.3",
8077
"@typeform/embed-react": "2.20.0",
8178
"dompurify": "^3.0.2",
79+
"monaco-editor": "0.44.0",
80+
"monaco-yaml": "5.1.1",
8281
"react": "^17.0.2",
8382
"react-dom": "^17.0.2",
8483
"react-draggable": "^4.4.5",
8584
"react-ga4": "^1.4.1",
8685
"react-mde": "^11.5.0",
86+
"react-monaco-editor": "^0.54.0",
8787
"react-router-dom": "^5.3.0",
8888
"react-select": "5.8.0",
8989
"rxjs": "^7.8.1",
@@ -99,7 +99,6 @@
9999
"jsonpath-plus": "^10.0.0",
100100
"react-dates": "^21.8.0",
101101
"react-diff-viewer-continued": "^3.4.0",
102-
"react-monaco-editor": "^0.54.0",
103102
"sass": "^1.69.7",
104103
"tslib": "2.7.0"
105104
},

vite.config.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,50 @@ export default defineConfig({
5151
output: {
5252
assetFileNames: 'assets/[name][extname]',
5353
entryFileNames: '[name].js',
54+
manualChunks(id: string) {
55+
if (
56+
id.includes('/node_modules/monaco-editor') ||
57+
id.includes('/node_modules/react-monaco-editor')
58+
) {
59+
return '@monaco-editor'
60+
}
61+
62+
if (id.includes('/node_modules/react-dates')) {
63+
return '@react-dates'
64+
}
65+
66+
if (id.includes('/node_modules/framer-motion')) {
67+
return '@framer-motion'
68+
}
69+
70+
if (id.includes('/node_modules/moment')) {
71+
return '@moment'
72+
}
73+
74+
if (id.includes('/node_modules/react-select')) {
75+
return '@react-select'
76+
}
77+
78+
if (id.includes('/node_modules/')) {
79+
return '@vendor'
80+
}
81+
82+
if (id.includes('src/Common/CodeEditor')) {
83+
return '@code-editor'
84+
}
85+
86+
if (id.includes('src/Common/RJSF')) {
87+
return '@common-rjsf'
88+
}
89+
90+
if (id.includes('src/Assets/Icons')) {
91+
return '@src-assets-icons'
92+
}
93+
94+
if (id.includes('src/Assets/Img')) {
95+
return '@src-assets-images'
96+
}
97+
}
5498
},
5599
},
56100
},

0 commit comments

Comments
 (0)