feat: 添加 VITE_APP_PUBLIC_BASE 环境变量配置
在 vite.config.ts 中添加 VITE_APP_PUBLIC_BASE 环境变量并配置 base 选项
This commit is contained in:
@@ -48,6 +48,7 @@ export default async ({ command, mode }) => {
|
||||
VITE_SERVER_BASEURL,
|
||||
VITE_DELETE_CONSOLE,
|
||||
VITE_SHOW_SOURCEMAP,
|
||||
VITE_APP_PUBLIC_BASE,
|
||||
VITE_APP_PROXY,
|
||||
VITE_APP_PROXY_PREFIX,
|
||||
} = env
|
||||
@@ -55,7 +56,7 @@ export default async ({ command, mode }) => {
|
||||
|
||||
return defineConfig({
|
||||
envDir: './env', // 自定义env目录
|
||||
|
||||
base: VITE_APP_PUBLIC_BASE, // TODO check
|
||||
plugins: [
|
||||
UniPages({
|
||||
exclude: ['**/components/**/**.*'],
|
||||
@@ -178,6 +179,7 @@ export default async ({ command, mode }) => {
|
||||
target: 'es6',
|
||||
// 开发环境不用压缩
|
||||
minify: mode === 'development' ? false : 'esbuild',
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user