Skip to content

Commit 6443070

Browse files
authored
perf: tree shaking and minify (#6068)
## Summary I believe tree-shaking does not affect [the shim](https://github.com/Comfy-Org/ComfyUI_frontend/blob/rizumu/perf/cloud-minify/build/plugins/comfyAPIPlugin.ts#L73), and it should safe to enable it. maybe we need to find the extension that will broke in this case. | | Rendered | Gzip | Brotli | |--------|-----------|----------|----------| | Before | 16.69 MB | 4.23 MB | 3.54 MB | | After | 12.07 MB | 3 MB | 2.53 MB |
1 parent 8396c9a commit 6443070

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

eslint.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@ export default defineConfig([
6767
...commonParserOptions,
6868
projectService: {
6969
allowDefaultProject: [
70-
'vite.config.mts',
7170
'vite.electron.config.mts',
72-
'vite.types.config.mts',
73-
'playwright.config.ts',
74-
'playwright.i18n.config.ts'
71+
'vite.types.config.mts'
7572
]
7673
}
7774
}

pnpm-workspace.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ catalog:
9898

9999
cleanupUnusedCatalogs: true
100100

101-
overrides:
102-
'@types/eslint': '-'
103-
104101
ignoredBuiltDependencies:
105102
- '@firebase/util'
106103
- protobufjs
@@ -115,3 +112,6 @@ onlyBuiltDependencies:
115112
- esbuild
116113
- nx
117114
- oxc-resolver
115+
116+
overrides:
117+
'@types/eslint': '-'

vite.config.mts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,12 @@ export default defineConfig({
187187
target: 'es2022',
188188
sourcemap: true,
189189
rollupOptions: {
190-
// Disabling tree-shaking
191-
// Prevent vite remove unused exports
192-
treeshake: false
190+
treeshake: true
193191
}
194192
},
195193

196194
esbuild: {
197-
minifyIdentifiers: false,
195+
minifyIdentifiers: SHOULD_MINIFY,
198196
keepNames: true,
199197
minifySyntax: SHOULD_MINIFY,
200198
minifyWhitespace: SHOULD_MINIFY

0 commit comments

Comments
 (0)