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.

29 lines
640 B

import { defineConfig, loadEnv } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const proxyTarget = env.VITE_API_PROXY_TARGET || 'http://127.0.0.1:8000'
return {
plugins: [uni()],
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/uni.scss"; @import "uview-plus/theme.scss";',
},
},
},
server: {
host: '0.0.0.0',
port: 5174,
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
},
},
}
})