refactor(projects): 精简版+动态路由权限初步

This commit is contained in:
Soybean
2022-01-03 22:20:10 +08:00
parent 7a0648dba5
commit de2057f141
354 changed files with 2053 additions and 22117 deletions

View File

@ -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
}
};
});