ruoyi-plus-soybean/vite.config.ts

40 lines
903 B
TypeScript
Raw Normal View History

import { fileURLToPath } from 'url';
import { defineConfig, loadEnv } from 'vite';
2022-01-08 20:49:21 +08:00
import { setupVitePlugins, define } from './build';
export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, `.env.${configEnv.mode}`);
return {
base: viteEnv.VITE_APP_BASE_URL,
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~': fileURLToPath(new URL('./', import.meta.url))
}
},
2022-01-08 20:49:21 +08:00
define,
plugins: setupVitePlugins(configEnv),
css: {
preprocessorOptions: {
scss: {
2022-01-24 11:30:08 +08:00
additionalData: `@use "./src/styles/scss/global.scss" as *;`
}
}
},
2022-02-12 23:39:42 +08:00
assetsInclude: ['/public/**'],
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
},
build: {
brotliSize: false,
sourcemap: false
}
};
});