Watch and rebuild plugins

Summary: Now, once we build all plugins before we start Flipper, we need to rebuild some of them when they change. Previously, it was handled by Metro when we included plugins int he bundle, but we no longer include them in the bundle.

Reviewed By: lblasa

Differential Revision: D39510213

fbshipit-source-id: a352d78946f844a25d9127ac09c26e43e6739ca9
This commit is contained in:
Andrey Goncharov
2022-09-15 10:02:19 -07:00
committed by Facebook GitHub Bot
parent 9dda947371
commit 3639feef61
4 changed files with 71 additions and 14 deletions

View File

@@ -19,6 +19,7 @@ import Watchman from './watchman';
import isFB from './isFB';
import yargs from 'yargs';
import ensurePluginFoldersWatchable from './ensurePluginFoldersWatchable';
import startWatchPlugins from './startWatchPlugins';
const argv = yargs
.usage('yarn flipper-server [args]')
@@ -149,12 +150,15 @@ async function startWatchChanges() {
// For UI changes, Metro / hot module reloading / fast refresh take care of the changes
await Promise.all(
[
'pkg',
'doctor',
'pkg-lib',
'plugin-lib',
'flipper-server',
'flipper-common',
'flipper-frontend-core',
'flipper-plugin-core',
'flipper-server-companion',
'flipper-server-core',
'flipper-server',
].map((dir) =>
watchman.startWatchFiles(
dir,
@@ -191,4 +195,5 @@ async function startWatchChanges() {
await restartServer();
// watch
await startWatchChanges();
await startWatchPlugins();
})();