diff --git a/build/.env.development b/build/.env.development new file mode 100644 index 0000000..33d6d60 --- /dev/null +++ b/build/.env.development @@ -0,0 +1,3 @@ +RENDERER_NODE_ENV = development +RENDERER_VUE_APP_PROXY = true +RENDERER_VUE_APP_API_BASEURL = http://192.1687.2:9999 diff --git a/build/.env.production b/build/.env.production new file mode 100644 index 0000000..6d7a1b0 --- /dev/null +++ b/build/.env.production @@ -0,0 +1,3 @@ +RENDERER_NODE_ENV = production +RENDERER_VUE_APP_PROXY = true +RENDERER_VUE_APP_API_BASEURL = http://192.1687.2:9999 diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 4490776..0297b45 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -2,6 +2,9 @@ import { resolve } from 'path' import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite' import vue from '@vitejs/plugin-vue' +const publicDir = resolve('resources') +const envDir = resolve('build') + export default defineConfig({ main: { plugins: [externalizeDepsPlugin(), bytecodePlugin()] @@ -10,6 +13,9 @@ export default defineConfig({ plugins: [externalizeDepsPlugin(), bytecodePlugin()] }, renderer: { + publicDir, + envDir, + envPrefix: 'RENDERER_', resolve: { alias: { '@renderer': resolve('src/renderer/src'), diff --git a/package.json b/package.json index 76fa6f7..e5eac4a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "electron-updater": "^6.3.9", "element-plus": "^2.11.3", "pinia": "^3.0.3", - "vue-qrcode": "^2.2.2", + "vue-qrcode": "^2.2.2", "vue-router": "^4.5.1" }, "devDependencies": {