From 77acb0a5b05748970ed7ba082080246094ccaf1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Sat, 2 Jul 2022 09:12:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=F0=9F=90=9E):=20=F0=9F=9A=A7=20Use=20['ENV?= =?UTF-8?q?=5FNAME']=20avoid=20vite:define=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 6c38268..1b376f1 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -25,7 +25,8 @@ export const ROOT_PATH = { let win: BrowserWindow | null = null // Here, you can also use other preload const preload = join(__dirname, '../preload/index.js') -const url = `http://${process.env.VITE_DEV_SERVER_HOST}:${process.env.VITE_DEV_SERVER_PORT}` +// 🚧 Use ['ENV_NAME'] avoid vite:define plugin +const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}` const indexHtml = join(ROOT_PATH.dist, 'index.html') async function createWindow() {