@@ -36,17 +36,7 @@ export const viteConfig: UserConfig = {
36
36
} ,
37
37
base : ensureLastSlash ( process . env . PUBLIC_URL ) ,
38
38
build : {
39
- minify : "terser" ,
40
- terserOptions : {
41
- compress : {
42
- drop_console : true ,
43
- drop_debugger : true ,
44
- pure_funcs : [ "console.info" , "console.debug" , "console.log" ] ,
45
- } ,
46
- format : {
47
- comments : false ,
48
- } ,
49
- } ,
39
+ minify : "terser" ,
50
40
chunkSizeWarningLimit : 500 ,
51
41
lib : {
52
42
formats : [ "es" ] ,
@@ -56,46 +46,31 @@ export const viteConfig: UserConfig = {
56
46
} ,
57
47
rollupOptions : {
58
48
treeshake : {
59
- moduleSideEffects : false ,
49
+ moduleSideEffects : true ,
60
50
propertyReadSideEffects : false ,
61
51
tryCatchDeoptimization : false ,
62
52
unknownGlobalSideEffects : false ,
63
53
} ,
64
54
external : [ "react" , "react-dom" ] ,
65
55
output : {
66
56
chunkFileNames : "chunks/[name]-[hash].js" ,
67
- entryFileNames : "entry/[name]-[hash] .js" ,
68
- assetFileNames : "assets/[name]-[hash].[ext] " ,
57
+ entryFileNames : "lowcoder-sdk .js" ,
58
+ assetFileNames : "style.css " ,
69
59
manualChunks : ( id ) => {
70
60
if ( id . includes ( "node_modules" ) ) {
71
- // CORE FRAMEWORK CHUNKS
72
- if ( id . includes ( "react" ) ) return "react" ;
73
- if ( id . includes ( "react-dom" ) ) return "react-dom" ;
74
- if ( id . includes ( "react-router" ) ) return "react-router" ;
75
- if ( id . includes ( "react-redux" ) ) return "react-redux" ;
76
- if ( id . includes ( "redux" ) ) return "redux" ;
77
- if ( id . includes ( "redux-saga" ) ) return "redux-saga" ;
78
-
79
61
// UI LIBRARIES
80
62
if ( id . includes ( "@ant-design/icons" ) ) return "ant-design-icons" ;
81
- if ( id . includes ( "antd" ) ) return "antd" ;
63
+ if ( id . includes ( "node_modules/ antd" ) ) return "antd" ;
82
64
if ( id . includes ( "styled-components" ) ) return "styled-components" ;
83
65
84
66
// 🔹 BARCODE & QR CODE PROCESSING
85
- if ( id . includes ( "zxing" ) || id . includes ( "Barcode" ) || id . includes ( "QRCode" ) || id . includes ( "PDF417" ) ) return "barcode" ;
86
-
87
- // CHARTING & DATA VISUALIZATION
88
- if ( id . includes ( "echarts" ) ) return "echarts" ;
89
- if ( id . includes ( "echarts-wordcloud" ) ) return "echarts-wordcloud" ;
90
- if ( id . includes ( "d3" ) ) return "d3" ;
67
+ if ( id . includes ( "react-qr-barcode-scanner" ) ) return "barcode" ;
91
68
92
69
// TEXT EDITORS & PARSERS
93
70
if ( id . includes ( "codemirror" ) ) return "codemirror" ;
94
71
if ( id . includes ( "quill" ) ) return "quill" ;
95
72
if ( id . includes ( "react-json-view" ) ) return "react-json-view" ;
96
- if ( id . includes ( "react-markdown" ) ) return "react-markdown" ;
97
73
if ( id . includes ( "react-quill" ) ) return "react-quill" ;
98
- if ( id . includes ( "remark" ) || id . includes ( "rehype" ) || id . includes ( "markdown" ) ) return "markdown-parsers" ;
99
74
if ( id . includes ( "remark-gfm" ) ) return "remark-gfm" ;
100
75
if ( id . includes ( "rehype-raw" ) ) return "rehype-raw" ;
101
76
if ( id . includes ( "rehype-sanitize" ) ) return "rehype-sanitize" ;
@@ -133,7 +108,6 @@ export const viteConfig: UserConfig = {
133
108
if ( id . includes ( "xlsx" ) ) return "xlsx" ;
134
109
if ( id . includes ( "alasql" ) ) return "alasql" ;
135
110
if ( id . includes ( "sql-formatter" ) ) return "sql-formatter" ;
136
- if ( id . includes ( "tern" ) ) return "tern" ;
137
111
138
112
// NETWORK & HTTP
139
113
if ( id . includes ( "axios" ) ) return "axios" ;
@@ -158,41 +132,38 @@ export const viteConfig: UserConfig = {
158
132
if ( id . includes ( "cnchar" ) ) return "cnchar" ;
159
133
if ( id . includes ( "hotkeys-js" ) ) return "hotkeys-js" ;
160
134
if ( id . includes ( "loglevel" ) ) return "loglevel" ;
161
- if ( id . includes ( "qrcode- react" ) ) return "qrcode-react" ;
135
+ if ( id . includes ( "qrcode. react" ) ) return "qrcode-react" ;
162
136
if ( id . includes ( "react-joyride" ) ) return "react-joyride" ;
163
137
if ( id . includes ( "rc-trigger" ) ) return "rc-trigger" ;
164
138
if ( id . includes ( "really-relaxed-json" ) ) return "really-relaxed-json" ;
165
139
if ( id . includes ( "simplebar-react" ) ) return "simplebar-react" ;
166
- return "vendor" ;
140
+ if ( id . includes ( "react-documents" ) ) return "react-documents" ;
141
+ if ( id . includes ( "react-colorful" ) ) return "react-colorful" ;
142
+ if ( id . includes ( "react-best-gradient-color-picker" ) ) return "react-best-gradient-color-picker" ;
143
+ if ( id . includes ( "@supabase/supabase-js" ) ) return "supabase" ;
144
+ return null ;
167
145
}
168
- if ( id . includes ( "src/api" ) ) return "api" ;
169
- if ( id . includes ( "src/appView" ) ) return "appView" ;
170
- if ( id . includes ( "src/base" ) ) return "base" ;
171
- if ( id . includes ( "src/constants" ) ) return "constants" ;
172
- if ( id . includes ( "src/i18n" ) ) return "i18n" ;
173
- if ( id . includes ( "src/ide" ) ) return "ide" ;
174
- if ( id . includes ( "src/layout" ) ) return "layout" ;
175
- if ( id . includes ( "src/pages" ) ) return "pages" ;
176
- if ( id . includes ( "src/redux" ) ) return "app_redux" ;
177
- if ( id . includes ( "src/comps" ) ) return "comps" ;
178
- if ( id . includes ( "comps/comps" ) ) return "comps2" ;
179
- if ( id . includes ( "comps/controls" ) ) return "controls" ;
180
- if ( id . includes ( "comps/queries" ) ) return "queries" ;
181
- if ( id . includes ( "comps/utils" ) ) return "utils" ;
182
- if ( id . includes ( "src/hooks" ) ) return "hooks" ;
183
- if ( id . includes ( "src/util" ) ) return "util" ;
184
- return "common" ; // 📦 Internal app shared code
185
- } ,
146
+ return null ;
147
+ }
186
148
} ,
187
149
experimental : {
188
150
minChunkSize : 300000 , // 📏 Force smaller chunks (~300KB)
189
151
} ,
190
152
plugins : [
191
- terser ( ) ,
153
+ terser ( {
154
+ compress : {
155
+ drop_console : true ,
156
+ drop_debugger : true ,
157
+ pure_funcs : [ "console.info" , "console.debug" , "console.log" ] ,
158
+ } ,
159
+ format : {
160
+ comments : / ( @ v i t e - i g n o r e | w e b p a c k I g n o r e ) /
161
+ } ,
162
+ } ) as PluginOption ,
192
163
strip ( {
193
164
functions : [ "console.log" , "debugger" ] , // ✅ Remove logs
194
165
sourceMap : true ,
195
- } ) ,
166
+ } ) as PluginOption ,
196
167
] ,
197
168
onwarn : ( warning , warn ) => {
198
169
if ( warning . code === 'MODULE_LEVEL_DIRECTIVE' ) {
0 commit comments