feat: 新增环境配置文件

This commit is contained in:
DEV_DSW
2025-09-25 17:07:31 +08:00
parent ceab08825a
commit 950b85e1e9
4 changed files with 13 additions and 1 deletions

3
build/.env.development Normal file
View File

@@ -0,0 +1,3 @@
RENDERER_NODE_ENV = development
RENDERER_VUE_APP_PROXY = true
RENDERER_VUE_APP_API_BASEURL = http://192.1687.2:9999

3
build/.env.production Normal file
View File

@@ -0,0 +1,3 @@
RENDERER_NODE_ENV = production
RENDERER_VUE_APP_PROXY = true
RENDERER_VUE_APP_API_BASEURL = http://192.1687.2:9999

View File

@@ -2,6 +2,9 @@ import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite' import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
const publicDir = resolve('resources')
const envDir = resolve('build')
export default defineConfig({ export default defineConfig({
main: { main: {
plugins: [externalizeDepsPlugin(), bytecodePlugin()] plugins: [externalizeDepsPlugin(), bytecodePlugin()]
@@ -10,6 +13,9 @@ export default defineConfig({
plugins: [externalizeDepsPlugin(), bytecodePlugin()] plugins: [externalizeDepsPlugin(), bytecodePlugin()]
}, },
renderer: { renderer: {
publicDir,
envDir,
envPrefix: 'RENDERER_',
resolve: { resolve: {
alias: { alias: {
'@renderer': resolve('src/renderer/src'), '@renderer': resolve('src/renderer/src'),

View File

@@ -28,7 +28,7 @@
"electron-updater": "^6.3.9", "electron-updater": "^6.3.9",
"element-plus": "^2.11.3", "element-plus": "^2.11.3",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"vue-qrcode": "^2.2.2", "vue-qrcode": "^2.2.2",
"vue-router": "^4.5.1" "vue-router": "^4.5.1"
}, },
"devDependencies": { "devDependencies": {