Cleanup plugin watch folders

Summary:
Watch folders weren't updated for cross plugin/flipper boundaries that have recently been removed

Fix changes in several source folders not being picked up when fast refresh wasn't enabled

Reviewed By: passy, aigoncharov

Differential Revision: D32626139

fbshipit-source-id: 2c830ec8154ff859ce1e3ee101e5963162d2e0a2
This commit is contained in:
Michel Weststrate
2021-12-08 04:25:28 -08:00
committed by Facebook GitHub Bot
parent e742322eb1
commit 2b81be6c29
2 changed files with 13 additions and 16 deletions

View File

@@ -244,6 +244,8 @@ async function startMetroServer(app: Express, server: http.Server) {
const watchFolders = (await getAppWatchFolders()).concat(
await getPluginSourceFolders(),
);
console.log('Source dirs\n\t' + watchFolders.join('\n\t'));
const baseConfig = await Metro.loadConfig();
const config = Object.assign({}, baseConfig, {
projectRoot: rootDir,
@@ -339,7 +341,15 @@ async function startWatchChanges(io: socketIo.Server) {
const watchman = new Watchman(path.resolve(__dirname, '..'));
await watchman.initialize();
await Promise.all(
['app', 'pkg', 'doctor', 'plugin-lib', 'flipper-plugin'].map((dir) =>
[
'app',
'pkg',
'doctor',
'plugin-lib',
'flipper-plugin',
'flipper-common',
'flipper-ui-core',
].map((dir) =>
watchman.startWatchFiles(
dir,
() => {