From 2aa9f158637fb121ecceaea31881d55e5985e1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=9A=E7=AA=97=E5=90=AC=E9=9B=A8=E4=B8=BF=E9=86=89?= =?UTF-8?q?=E6=97=A0=E5=BF=83?= <994039348@qq.com> Date: Mon, 25 Jul 2022 16:17:31 +0800 Subject: [PATCH] =?UTF-8?q?[WebComponentsEditor]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B0=20vite=20v3=20=E5=90=8E,=20?= =?UTF-8?q?=E6=89=93=E5=8C=85=E5=90=8E=E7=9A=84=E7=BB=84=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=B8=AD=E5=8C=85=E5=90=AB=20`process.env.*`=20?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/vitejs/vite/pull/8090 --- WebComponentsEditor/scripts/build.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WebComponentsEditor/scripts/build.ts b/WebComponentsEditor/scripts/build.ts index c7038aa..03f80b1 100644 --- a/WebComponentsEditor/scripts/build.ts +++ b/WebComponentsEditor/scripts/build.ts @@ -51,6 +51,9 @@ const outDirPath = resolve(rootPath, 'dist'); const viteExtraConfig: InlineConfig = { configFile: viteConfigPath ? resolve(srcPath, viteConfigPath) : false, publicDir: resolve(rootPath, 'public', name), + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, build: { minify: true, outDir: resolve(outDirPath, name),