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:
committed by
Facebook Github Bot
parent
dd7924c963
commit
5d99817555
@@ -84,6 +84,10 @@ async function createZip(buildDir, distDir, targets) {
|
|||||||
platformPostfix = '';
|
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';
|
process.env.BUILD_HEADLESS = 'true';
|
||||||
const buildDir = await buildFolder();
|
const buildDir = await buildFolder();
|
||||||
const distDir = path.join(__dirname, '..', 'dist');
|
const distDir = path.join(__dirname, '..', 'dist');
|
||||||
@@ -93,7 +97,10 @@ async function createZip(buildDir, distDir, targets) {
|
|||||||
const versionNumber = getVersionNumber();
|
const versionNumber = getVersionNumber();
|
||||||
const buildRevision = await genMercurialRevision();
|
const buildRevision = await genMercurialRevision();
|
||||||
await preludeBundle(buildDir, versionNumber, buildRevision);
|
await preludeBundle(buildDir, versionNumber, buildRevision);
|
||||||
await compileDefaultPlugins(path.join(buildDir, PLUGINS_FOLDER_NAME));
|
await compileDefaultPlugins(
|
||||||
|
path.join(buildDir, PLUGINS_FOLDER_NAME),
|
||||||
|
skipPlugins,
|
||||||
|
);
|
||||||
await createBinary([
|
await createBinary([
|
||||||
path.join(buildDir, 'bundle.js'),
|
path.join(buildDir, 'bundle.js'),
|
||||||
'--output',
|
'--output',
|
||||||
|
|||||||
@@ -17,13 +17,15 @@ function die(err) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function compileDefaultPlugins(defaultPluginDir) {
|
function compileDefaultPlugins(defaultPluginDir, skipAll = false) {
|
||||||
return compilePlugins(
|
return compilePlugins(
|
||||||
null,
|
null,
|
||||||
[
|
skipAll
|
||||||
path.join(__dirname, '..', 'src', 'plugins'),
|
? []
|
||||||
path.join(__dirname, '..', 'src', 'fb', 'plugins'),
|
: [
|
||||||
],
|
path.join(__dirname, '..', 'src', 'plugins'),
|
||||||
|
path.join(__dirname, '..', 'src', 'fb', 'plugins'),
|
||||||
|
],
|
||||||
defaultPluginDir,
|
defaultPluginDir,
|
||||||
{force: true, failSilently: false},
|
{force: true, failSilently: false},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user