-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Garfish 微前端,子应用在主应用中时,热更新失效 #2935
Comments
主应用关闭 hmr 就好了 🌚 dev: {
hmr: false,
}, |
那主应用还可以热更新吗 |
主应用会降级为 liveReload,我感觉用起来和热更新区别不大 |
上面这个可以解决 js 的热更新问题。 我发现 Garfish 默认会把子应用的样式资源转换成 style 标签,所以 css 热更新需要把 disableLinkTransformToStyle 改成 true Garfish.run({
basename: '/',
disablePreloadApp: true,
sandbox: {
// 解决子应用在微前端环境下的 css 热更新问题
disableLinkTransformToStyle: true,
},
}) |
能不能同时关闭sandbox和 disableLinkTransformToStyle: true, |
Version
Details
Garfish 微前端框架,主子应用本地启动,子应用独立运行,热更新正常,在主应用中运行,热更新失效。
依赖版本:
garfish:
1.19.2
@garfish/bridge-react-v18:
1.19.2
@rsbuild/core:
1.0.1-beta.1
@rsbuild/plugin-react:
1.0.1-beta.1
按照文档改了改,怎么都不好使,参考的文档:
hot-update.js 中请求返回的内容是最新的代码,看起来像是没有符合 React 对热更新的要求,辛苦大佬帮忙看看,感谢 ❤️ 。
Reproduce link
https://github.com/xlsama/rsbuild-demo
Reproduce Steps
pnpm dev
,主应用地址:http://localhost:3000
,子应用地址:http://localhost:3001
http://localhost:3000
, 修改子应用react-sub/src/App.tsx
中的代码,http://localhost:3001
热更新正常,http://localhost:3000
热更新失效。The text was updated successfully, but these errors were encountered: