From 464f600a856968848610814f3e6cd9cd7b686f5c Mon Sep 17 00:00:00 2001 From: YeungHoiChiu <1005935991@qq.com> Date: Thu, 8 Aug 2024 20:46:37 +0800 Subject: [PATCH 1/2] resolve: npm run build failure, set `chunkSizeWarningLimit` to 600KiB --- vite.config.js | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/vite.config.js b/vite.config.js index 69e06a11..5dc2dab7 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,27 +1,32 @@ -import {defineConfig} from 'vite'; -import {join} from 'path'; +import { defineConfig } from 'vite'; +import { join } from 'path'; import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], - server:{ - port: 3002 - }, - build: { - rollupOptions: { - output: { - manualChunks(id) { - if (id.includes('node_modules')) { - return id.toString().split('node_modules/')[1].split('/')[0].toString(); - } - } - } - } - }, - resolve: { - alias: { - '@': join(__dirname, 'src'), + plugins: [vue()], + server: { + port: 3002, + }, + build: { + chunkSizeWarningLimit: 600 * 1024, // 设置警告阈值为600KiB,因为element-plus超过500kb导致打包失败 + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + return id + .toString() + .split('node_modules/')[1] + .split('/')[0] + .toString(); + } }, + }, + }, + }, + resolve: { + alias: { + '@': join(__dirname, 'src'), }, + }, }); From b0b3b02592a976f91d44493a5a5d45dda58350e9 Mon Sep 17 00:00:00 2001 From: YeungHoiChiu <1005935991@qq.com> Date: Thu, 8 Aug 2024 22:50:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=88=86=E7=BB=84=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9=E6=9C=AA=E8=80=83=E8=99=91?= =?UTF-8?q?=E5=88=B0=E5=85=AC=E5=85=B1=E6=AD=A5=E9=AA=A4=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E6=80=A7=EF=BC=8C=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E6=AD=A5=E9=AA=A4=E7=BC=96=E8=BE=91=E6=97=B6?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E5=AD=90=E6=AD=A5=E9=AA=A4=E7=A6=BB=E5=BC=80?= =?UTF-8?q?=E5=A4=AB=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PublicStepUpdate.vue | 1 + src/components/StepDraggable.vue | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/PublicStepUpdate.vue b/src/components/PublicStepUpdate.vue index e26c7417..e7d08b43 100644 --- a/src/components/PublicStepUpdate.vue +++ b/src/components/PublicStepUpdate.vue @@ -291,6 +291,7 @@ const jump = (id) => { {