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

@@ -16,6 +16,7 @@ import {homedir} from 'os';
import {runBuild, PluginDetails} from 'flipper-pkg-lib';
import getPlugins from './getPlugins';
import startWatchPlugins from './startWatchPlugins';
import ensurePluginFoldersWatchable from './ensurePluginFoldersWatchable';
const HOME_DIR = homedir();
@@ -44,6 +45,7 @@ export default async function (
);
return [];
}
await ensurePluginFoldersWatchable();
options = Object.assign({}, DEFAULT_COMPILE_OPTIONS, options);
const defaultPlugins = (
await fs.readJson(path.join(__dirname, 'defaultPlugins', 'index.json'))