Dev mode: fixed loading plugins located outside of the Flipper source root folder

Summary: Dev mode: fixed loading of plugins located outside of the Flipper source root folder, e.g. in ~/flipper-plugins as suggested in tutorial docs.

Reviewed By: passy

Differential Revision: D21306639

fbshipit-source-id: bb9044b25324065f0c12169b95fbe663da8d4305
This commit is contained in:
Anton Nikolaev
2020-04-30 04:25:28 -07:00
committed by Facebook GitHub Bot
parent b27f8ee236
commit c21ccedf14
11 changed files with 172 additions and 45 deletions

View File

@@ -28,6 +28,7 @@ import getAppWatchFolders from './get-app-watch-folders';
import getPlugins from '../static/getPlugins';
import getPluginFolders from '../static/getPluginFolders';
import startWatchPlugins from '../static/startWatchPlugins';
import ensurePluginFoldersWatchable from '../static/ensurePluginFoldersWatchable';
const ansiToHtmlConverter = new AnsiToHtmlConverter();
@@ -268,12 +269,13 @@ function outputScreen(socket?: socketIo.Server) {
}
(async () => {
await generatePluginEntryPoints();
await ensurePluginFoldersWatchable();
const port = await detect(DEFAULT_PORT);
const {app, server} = await startAssetServer(port);
const socket = await addWebsocket(server);
await startMetroServer(app, server);
outputScreen(socket);
await compileMain();
await generatePluginEntryPoints();
shutdownElectron = launchElectron(port);
})();