chore: 调整环境配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# 只在开发模式中被载入
|
||||
ENV = 'development'
|
||||
VITE_NODE_ENV = 'development'
|
||||
|
||||
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
|
||||
VITE_BASE_URL = /
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 只在生产模式中被载入
|
||||
ENV = 'production'
|
||||
VITE_NODE_ENV = 'production'
|
||||
|
||||
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
|
||||
VITE_BASE_URL = /
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 只在预发布模式中被载入
|
||||
ENV = 'staging'
|
||||
VITE_NODE_ENV = 'staging'
|
||||
|
||||
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
|
||||
VITE_BASE_URL = /
|
||||
|
||||
@@ -6,6 +6,7 @@ import path from "path";
|
||||
|
||||
// @ts-ignore
|
||||
export default defineConfig(({ mode }) => {
|
||||
console.log("mode", mode);
|
||||
const env = loadEnv(mode, process.cwd(), ["VITE_"]);
|
||||
|
||||
return {
|
||||
@@ -26,10 +27,10 @@ export default defineConfig(({ mode }) => {
|
||||
// 注入环境变量到客户端
|
||||
"process.env": JSON.stringify(env),
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(process.cwd(), "../../dist/renderer"),
|
||||
clean: true,
|
||||
},
|
||||
// output: {
|
||||
// path: path.resolve(process.cwd(), "../../dist/renderer"),
|
||||
// clean: true,
|
||||
// },
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user