feat: 新增环境配置文件
This commit is contained in:
3
build/.env.development
Normal file
3
build/.env.development
Normal 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
3
build/.env.production
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
RENDERER_NODE_ENV = production
|
||||||
|
RENDERER_VUE_APP_PROXY = true
|
||||||
|
RENDERER_VUE_APP_API_BASEURL = http://192.1687.2:9999
|
||||||
@@ -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'),
|
||||||
|
|||||||
Reference in New Issue
Block a user