chore: 调整环境配置
This commit is contained in:
parent
7c6a86edf6
commit
09ff94c188
@ -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 = /
|
||||
|
@ -46,10 +46,10 @@ export default defineConfig(({ mode }) => {
|
||||
define: {
|
||||
// 注入环境变量到客户端
|
||||
__APP_ENV__: JSON.stringify(env)
|
||||
},
|
||||
build: {
|
||||
outDir: path.resolve(process.cwd(), '../../dist/designer'), // 输出到根目录/designer
|
||||
emptyOutDir: true // 构建前清空目录
|
||||
}
|
||||
// build: {
|
||||
// outDir: path.resolve(process.cwd(), '../../dist/designer'),
|
||||
// emptyOutDir: true // 构建前清空目录
|
||||
// }
|
||||
};
|
||||
});
|
||||
|
@ -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 = /
|
||||
|
@ -24,6 +24,7 @@ const __APP_INFO__ = {
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
console.log('mode', mode);
|
||||
// 环境变量
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_', 'VTJ_', 'SY_']);
|
||||
const isDev = command === 'serve';
|
||||
@ -119,7 +120,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: resolve(process.cwd(), '../../dist/platform'), // 输出到根目录/designer
|
||||
// outDir: resolve(process.cwd(), '../../dist/platform'), // 输出到根目录/designer
|
||||
emptyOutDir: true,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
|
@ -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,
|
||||
// },
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -9,6 +9,7 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
// @ts-ignore
|
||||
export default defineConfig(({ mode }) => {
|
||||
console.log("mode", mode);
|
||||
const env = loadEnv(mode, process.cwd(), ["VITE_"]);
|
||||
return {
|
||||
plugins: [less()],
|
||||
@ -37,10 +38,10 @@ export default defineConfig(({ mode }) => {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(process.cwd(), "../../dist/y-code-v1"),
|
||||
clean: true,
|
||||
},
|
||||
// output: {
|
||||
// path: path.resolve(process.cwd(), "../../dist/y-code-v1"),
|
||||
// clean: true,
|
||||
// },
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -60,7 +60,11 @@
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$"
|
||||
],
|
||||
"outputs": []
|
||||
"outputs": [
|
||||
"dist/**",
|
||||
"types/**",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user