chore: 统一各 app 的构建目录
This commit is contained in:
@@ -17,8 +17,6 @@ import type { UserConfig, ConfigEnv } from 'vite';
|
||||
|
||||
// console.log(DEV_SERVER_PORT);
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
const __APP_INFO__ = {
|
||||
pkg,
|
||||
lastBuildTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
@@ -27,12 +25,14 @@ const __APP_INFO__ = {
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
// 环境变量
|
||||
const { VITE_BASE_API_URL, VITE_BASE_URL, ENV } = loadEnv(mode, CWD);
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_', 'VTJ_', 'SY_']);
|
||||
const isDev = command === 'serve';
|
||||
|
||||
return {
|
||||
define: {
|
||||
__APP_INFO__: JSON.stringify(__APP_INFO__),
|
||||
// 注入环境变量到客户端
|
||||
__APP_ENV__: JSON.stringify(env),
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
@@ -64,7 +64,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
Http2Proxy(),
|
||||
createSvgIconsPlugin({
|
||||
// Specify the icon folder to be cached
|
||||
iconDirs: [resolve(CWD, 'src/assets/icons')],
|
||||
iconDirs: [resolve(process.cwd(), 'src/assets/icons')],
|
||||
// Specify symbolId format
|
||||
symbolId: 'svg-icon-[dir]-[name]',
|
||||
}),
|
||||
@@ -119,7 +119,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
outDir: resolve(process.cwd(), '../../dist/platform'), // 输出到根目录/designer
|
||||
emptyOutDir: true,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
|
||||
Reference in New Issue
Block a user