33 lines
701 B
JavaScript
33 lines
701 B
JavaScript
import { defineConfig } from 'vite'
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [uni()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 8000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
// 1. 切换为 Modern API,解决 [legacy-js-api] 警告
|
|
api: 'modern-compiler',
|
|
// 2. 静音 [import] 和 [legacy-js-api] 等弃用警告
|
|
silenceDeprecations: ['legacy-js-api', 'import'],
|
|
},
|
|
},
|
|
},
|
|
})
|