当 node_modules/mypackage 中的源发生变化时,如何将 Metro 配置为热重载?

问题描述

在 React Native 应用程序中,我使用以下 metro.config.js支持符号链接https://github.com/react-native-community/cli/issues/1238#issue-673055870

符号链接工作正常,当我更新屏幕上显示的源 Refreshing 时,我可以看到。

然而,源仍然是旧的,我必须重新启动metro进程和应用程序才能真正看到变化。

如何将 Metro 配置为从链接的模块中热重载更改?

这就是我在 watchFolders 地铁选项中所拥有的:

['/home/dka/.config/yarn/link/@pass-culture/id-check']

这就是我运行 watchman watch-list 时所拥有的:

watchman watch-list
{
    "version": "20210124.162314.0","roots": [
        "/home/dka/workspace/github.com/pass-culture/id-check-front/packages/id-check","/home/dka/workspace/github.com/pass-culture/pass-culture-app-native"
    ]
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)