admin管理员组文章数量:1404753
Current Process:
I am using Webpack in a React app to enable Module Federation. I have two apps: App1 (the main application) and App2 (the remote application).
I have configured App1 to run on port 3000 and App2 on port 3001. Inside webpack.config.js, I have set the remote URI for App2 as http://localhost:3001. I build my React app, I test it, and everything works as expected. Now, I want to deploy the build/dist folder and using NGINX to configure the domain. domain: - App1 will be redirected to this URI.
Problem:
The problem is that the remote URI is hardcoded inside the build/dist folder by Webpack. Since I am now planning to use a domain, I need to update the remote URI to something like [ on /app2 the 3001 port will be redirected].
What I want is a way to make the remote URI dynamic so that I can build the app once and update the remote URI at any time to use it anywhere.
Please let me know if you need any further details.
本文标签: reactjsDynamic Remote URI for Webpack Module FederationStack Overflow
版权声明:本文标题:reactjs - Dynamic Remote URI for Webpack Module Federation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744844074a2628095.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论