Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError in shouldSkipBundle During yarn build-for-devtools-dev and yarn build-for-devtools-prod Commands #29906

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ function parseRequestedNames(names, toCase) {
return result;
}

const argvType = Array.isArray(argv.type) ? argv.type : [argv.type];
const requestedBundleTypes = argv.type
? parseRequestedNames([argv.type], 'uppercase')
? parseRequestedNames(argvType, 'uppercase')
: [];

const requestedBundleNames = parseRequestedNames(argv._, 'lowercase');
const forcePrettyOutput = argv.pretty;
const isWatchMode = argv.watch;
Expand Down Expand Up @@ -528,8 +530,8 @@ function shouldSkipBundle(bundle, bundleType) {
return true;
}
if (requestedBundleTypes.length > 0) {
const isAskingForDifferentType = requestedBundleTypes.every(
requestedType => bundleType.indexOf(requestedType) === -1
const isAskingForDifferentType = requestedBundleTypes.some(
requestedType => !bundleType.includes(requestedType)
);
if (isAskingForDifferentType) {
return true;
Expand Down