12345678910111213141516171819202122232425262728 |
- import { defineConfig } from 'vite'
- import uni from '@dcloudio/vite-plugin-uni'
- import { fileURLToPath, URL } from 'node:url'
- // https://vitejs.dev/config/
- export default defineConfig({
- transpileDependencies: ['@dcloudio/uni-ui'],
- plugins: [
- uni(),
- ],
- server: {
- proxy: {
- // 接口地址代理
- '/api': {
- target: 'http://kcapp.gzzzyd.com/', // 接口的域名
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- rewrite: path => path.replace(/^\/demo/, '/demo')
- },
- }
- },
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- }
- })
|