Add --no-plugins arg to speed up headless development

Summary:
Compiling headless flipper takes a long time. This is because it individually compiles and bundles every plugin.

When debugging core headless, you don't need to compile any plugins, so this adds a build flag `--no-plugins` to skip that and vastly speed up iteration speed.

Reduces build time from 3 minutes to 20s

Reviewed By: priteshrnandgaonkar

Differential Revision: D16131322

fbshipit-source-id: 2b38ee37183a1257b3993f392cf623b2631fd7da
This commit is contained in:
John Knox
2019-07-05 07:57:12 -07:00
committed by Facebook Github Bot
parent dd7924c963
commit 5d99817555
2 changed files with 15 additions and 6 deletions

View File

@@ -84,6 +84,10 @@ async function createZip(buildDir, distDir, targets) {
platformPostfix = '';
}
// Compiling all plugins takes a long time. Use this flag for quicker
// developement iteration by not including any plugins.
const skipPlugins = process.argv.indexOf('--no-plugins') > -1;
process.env.BUILD_HEADLESS = 'true';
const buildDir = await buildFolder();
const distDir = path.join(__dirname, '..', 'dist');
@@ -93,7 +97,10 @@ async function createZip(buildDir, distDir, targets) {
const versionNumber = getVersionNumber();
const buildRevision = await genMercurialRevision();
await preludeBundle(buildDir, versionNumber, buildRevision);
await compileDefaultPlugins(path.join(buildDir, PLUGINS_FOLDER_NAME));
await compileDefaultPlugins(
path.join(buildDir, PLUGINS_FOLDER_NAME),
skipPlugins,
);
await createBinary([
path.join(buildDir, 'bundle.js'),
'--output',