ruoyi-plus-soybean/vite.config.ts

34 lines
771 B
TypeScript
Raw Normal View History

import { fileURLToPath } from 'url';
import { defineConfig, loadEnv } from 'vite';
import { setupVitePlugins } from './build';
export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, `.env.${configEnv.mode}`);
return {
base: viteEnv.BASE_URL,
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~': fileURLToPath(new URL('./', import.meta.url))
}
},
plugins: setupVitePlugins(configEnv),
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "./src/styles/scss/global.scss" as *;`
}
}
},
server: {
2021-12-24 11:00:10 +08:00
fs: {
strict: false
},
2021-11-29 10:57:29 +08:00
host: '0.0.0.0',
port: 3200,
2021-12-15 13:47:02 +08:00
open: true
}
};
});