From 0f774dacdee9f4859cedde20b90aef3c6b1da03c Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Sun, 24 Mar 2024 18:55:17 +0800 Subject: [PATCH] optimize the construction parameters --- electron.vite.config.ts | 15 ++------------- package.json | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 795b06924..9f762a3d9 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -43,21 +43,10 @@ export default defineConfig(({ mode }: ConfigEnv) => { } }, build: { - assetsInclude: ['./src/renderer/src/utils/drpy/drpy3.ts'], - minify: 'terser', emptyOutDir: true, // 打包时先清空上一次构建生成的目录 reportCompressedSize: false, // 关闭文件计算 - sourcemap: true, // 关闭生成map文件 可以达到缩小打包体积 - terserOptions: { - // 禁用代码优化 - compress: false, - mangle: false, - format: { - comments: false, - }, - }, + sourcemap: false, // 关闭生成map文件 可以达到缩小打包体积 rollupOptions: { - treeshake: false, // 关闭代码分割[重要], 否则eval执行时缺少全局变量和方法 output: { entryFileNames: `assets/entry/[name][hash].js`, // 引入文件名的名称 chunkFileNames: `assets/chunk/[name][hash].js`, // 包的入口文件名称 @@ -108,7 +97,7 @@ export default defineConfig(({ mode }: ConfigEnv) => { splitVendorChunkPlugin() ], server: { - strictPort: true, + strictPort: true, // 端口冲突自动分配端口 proxy: { [VITE_API_URL_PREFIX]: { target: VITE_API_URL, // 后台接口域名 diff --git a/package.json b/package.json index aa38ba81c..991445bb3 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,6 @@ "stylelint-order": "~6.0.4", "tdesign-icons-vue-next": "^0.2.2", "tdesign-vue-next": "^1.9.0", - "terser": "^5.29.2", "typescript": "^5.4.2", "unplugin-auto-import": "^0.17.5", "unplugin-vue-components": "^0.26.0",