vite.config.js 598 B

123456789101112131415161718192021222324
  1. import { defineConfig } from 'vite';
  2. import uni from '@dcloudio/vite-plugin-uni';
  3. export default defineConfig({
  4. plugins: [
  5. uni(),
  6. // "@babel/plugin-proposal-nullish-coalescing-operator",
  7. // "@babel/plugin-proposal-optional-chaining"
  8. ],
  9. build: {
  10. sourcemap: true
  11. },
  12. server: {
  13. proxy: {
  14. '/devHost': {
  15. target: 'https://intoystox.com', // 目标路径
  16. // target: 'https://www.b-beng.com', // 目标路径
  17. changeOrigin: true, // 改变请求源
  18. secure: true, // 不使用HTTPS
  19. rewrite: (path) => path.replace(/^\/devHost/, ''), // 重写请求路径
  20. },
  21. }
  22. }
  23. });