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.

18 lines
689 B

5 months ago
  1. import { defineConfig } from 'vite';
  2. import uni from '@dcloudio/vite-plugin-uni';
  3. export default defineConfig({
  4. plugins: [uni()],
  5. server: {
  6. host: "localhost", // 指定服务器应该监听哪个IP地址,默认:localhost
  7. port: 5173, // 指定开发服务器端口,默认:5173
  8. proxy: { // 为开发服务器配置自定义代理规则
  9. // 带选项写法:http://localhost:5173/api/posts -> http://jsonplaceholder.typicode.com/posts
  10. "/h5api": {
  11. target: 'http://192.168.9.19:8080', // 目标接口
  12. changeOrigin: true, // 是否换源
  13. rewrite: (path) => path.replace(/^\/h5api/, ""),
  14. }
  15. }
  16. }
  17. });