mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-13 05:13:41 +08:00
refactor(projects): 细节优化
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { viteDefine, setupVitePlugins, createViteProxy } from './build';
|
||||
import { getEnvConfig } from './.env-config';
|
||||
|
||||
export default defineConfig(configEnv => {
|
||||
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as ImportMetaEnv;
|
||||
@@ -8,6 +9,9 @@ export default defineConfig(configEnv => {
|
||||
const rootPath = fileURLToPath(new URL('./', import.meta.url));
|
||||
const srcPath = `${rootPath}src`;
|
||||
|
||||
const isOpenProxy = viteEnv.VITE_HTTP_PROXY === 'true';
|
||||
const envConfig = getEnvConfig(viteEnv);
|
||||
|
||||
return {
|
||||
base: viteEnv.VITE_BASE_URL,
|
||||
resolve: {
|
||||
@@ -29,7 +33,7 @@ export default defineConfig(configEnv => {
|
||||
host: '0.0.0.0',
|
||||
port: 3200,
|
||||
open: true,
|
||||
proxy: createViteProxy(viteEnv)
|
||||
proxy: createViteProxy(isOpenProxy, envConfig)
|
||||
},
|
||||
build: {
|
||||
brotliSize: false
|
||||
|
Reference in New Issue
Block a user