diff --git a/scripts/rollup/build-all-release-channels.js b/scripts/rollup/build-all-release-channels.js index 0e43faa1f837b..b7bc76a1aaaed 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -17,6 +17,7 @@ const { } = require('../../ReactVersions'); const yargs = require('yargs'); const {buildEverything} = require('./build-ghaction'); +const Bundles = require('./bundles'); // Runs the build script for both stable and experimental release channels, // by configuring an environment variable. @@ -79,6 +80,37 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({ type: 'choices', choices: ['circleci', 'github'], }, + bundle: { + describe: 'Build the given bundle type.', + requiresArg: false, + type: 'choices', + choices: [...Object.values(Bundles.bundleTypes)], + }, + names: { + describe: 'Build for matched bundle names. Example: "react-test,index.js".', + requiresArg: false, + type: 'array', + }, + pretty: { + describe: 'Force pretty output.', + requiresArg: false, + type: 'boolean', + }, + 'sync-fbsource': { + describe: 'Include to sync build to fbsource.', + requiresArg: false, + type: 'string', + }, + 'sync-www': { + describe: 'Include to sync build to www.', + requiresArg: false, + type: 'string', + }, + 'unsafe-partial': { + describe: 'Do not clean ./build first.', + requiresArg: false, + type: 'boolean', + }, }).argv; async function main() { diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 7990c5d0b86fb..cfa8710354e73 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -84,13 +84,13 @@ function parseRequestedNames(names, toCase) { } return result; } +const argvType = Array.isArray(argv.bundle) ? argv.bundle : [argv.bundle]; +const requestedBundleTypes = argv.bundle ? argvType : []; -const argvType = Array.isArray(argv.type) ? argv.type : [argv.type]; -const requestedBundleTypes = argv.type - ? parseRequestedNames(argvType, 'uppercase') - : []; - -const requestedBundleNames = parseRequestedNames(argv._, 'lowercase'); +const requestedBundleNames = parseRequestedNames( + argv.names ? argv.names : [], + 'lowercase' +); const forcePrettyOutput = argv.pretty; const isWatchMode = argv.watch; const syncFBSourcePath = argv['sync-fbsource'];