mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
refactor(projects): 精简版+动态路由权限初步
This commit is contained in:
@ -1,18 +1,19 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import path from 'path';
|
||||
import { plugins, define } from './build';
|
||||
import { setupVitePlugins } from './build';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const viteEnv = loadEnv(mode, `.env.${mode}`);
|
||||
export default defineConfig(configEnv => {
|
||||
const viteEnv = loadEnv(configEnv.mode, `.env.${configEnv.mode}`);
|
||||
|
||||
return {
|
||||
base: viteEnv.VITE_BASE_URL,
|
||||
base: viteEnv.BASE_URL,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src')
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'~': fileURLToPath(new URL('./', import.meta.url))
|
||||
}
|
||||
},
|
||||
define,
|
||||
plugins: setupVitePlugins(configEnv),
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
@ -20,18 +21,13 @@ export default defineConfig(({ mode }) => {
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins,
|
||||
server: {
|
||||
fs: {
|
||||
strict: false
|
||||
},
|
||||
host: '0.0.0.0',
|
||||
port: 3100,
|
||||
port: 3200,
|
||||
open: true
|
||||
},
|
||||
build: {
|
||||
brotliSize: false,
|
||||
sourcemap: false
|
||||
}
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user