31 lines
758 B
TypeScript
31 lines
758 B
TypeScript
|
|
import { defineConfig } from 'vite';
|
|||
|
|
import vue from '@vitejs/plugin-vue';
|
|||
|
|
import { fileURLToPath, URL } from 'node:url';
|
|||
|
|
|
|||
|
|
export default defineConfig({
|
|||
|
|
plugins: [vue()],
|
|||
|
|
resolve: {
|
|||
|
|
alias: {
|
|||
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
css: {
|
|||
|
|
preprocessorOptions: {
|
|||
|
|
scss: {
|
|||
|
|
// 避免 Dart Sass Legacy JS API 告警(Vite 默认 legacy);非法的 silenceDeprecations 条目会刷屏
|
|||
|
|
api: 'modern-compiler',
|
|||
|
|
additionalData: `@use "@/assets/styles/_variables.scss" as *;\n`,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
server: {
|
|||
|
|
port: 3000,
|
|||
|
|
proxy: {
|
|||
|
|
'/api': {
|
|||
|
|
target: process.env.VITE_API_PROXY_TARGET || 'http://127.0.0.1:8080',
|
|||
|
|
changeOrigin: true,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
});
|