首页 > 解决方案 > node_modules/mypackage 中的源更改时如何将 Metro 配置为热重载?

问题描述

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

Symlink 工作正常,当我更新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"
    ]
}

标签: javascriptreactjsreact-nativemetro-bundlerwatchman

解决方案


推荐阅读