hotOnly: true, //是否开启热更新 proxy: { '/apis': { target: 'http://localhost:8080/', //API服务器的地址 ws: true, //代理websockets changeOrigin: true, // 是否跨域,虚拟的站点需要更管origin pathRewrite: { '^/api5': '/apis', '^/apis': '', } }, }, } } 1. 2. 3. 4. ...
so we have removed the origin and tried other fix and we had to use proxy for node_modules like this: '/node_modules': 'http://localhost:8080/base/url/', I think this is because module federation is using the origin to build the path but the origin destroy somehow pathing for assets...
VITE_PROXY_DOMAIN = /api # 开发环境路由历史模式 VITE_ROUTER_HISTORY = "hash" # 开发环境后端地址 VITE_PROXY_DOMAIN_REAL = "http://127.0.0.1:3000" 3 changes: 0 additions & 3 deletions 3 .env.production Original file line numberDiff line numberDiff line change @@ -4,9 +4,6 @@ VIT...
Describe the bug vite base full url option seems not work in development export default defineConfig({ base: 'http://localhost:3000/test/', plugins: [vue({ template: { transformAssetUrls: { base: 'http://localhost:3000/test/', } } })] })...
exportfunctioncreateViteProxy(env:Env.ImportMeta,enable:boolean){ constisEnableHttpProxy=enable&&env.VITE_HTTP_PROXY==='Y'; if(!isEnableHttpProxy)returnundefined; Expand Down 1 change: 1 addition & 0 deletions1package.json Original file line numberDiff line numberDiff line change ...