proxy.ts 507 B

12345678910111213141516
  1. // import type { ProxyOptions } from '@rsbuild/core'
  2. // type ProxyTargetList = Record<string, ProxyOptions>
  3. // const proxy = (env: Record<string, any>): ProxyTargetList => {
  4. // const { VUE_APP_MOCK_API, VUE_APP_BASE_API, VUE_APP_IS_MOCK } = env
  5. // return {
  6. // '/dev-api': {
  7. // target: VUE_APP_IS_MOCK === 'true' ? VUE_APP_MOCK_API : VUE_APP_BASE_API,
  8. // changeOrigin: true,
  9. // pathRewrite: (path) => path.replace(/^\/dev-api/, ''),
  10. // },
  11. // }
  12. // }
  13. // export default proxy