You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1 KiB

1 year ago
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import path from 'path'
import Unocss from 'unocss/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
// https://github.com/antfu/unocss
Unocss()
],
server: {
port: 81,
host: '0.0.0.0',
proxy: {
'/api/': {
target:
'https://service-rbji0bev-1256505457.cd.apigw.tencentcs.com/release',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
},
'/api-prod/': {
target: 'http://localhost:3001',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api-prod/, '')
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components')
}
},
css: {
// 配置`scss`和`less`全局变量
preprocessorOptions: {
scss: {
additionalData: '@import "@/styles/vars/_base.scss";'
},
less: {
additionalData: '@import "@/styles/vars/_base.less";'
}
}
}
})