From fe6b92b71d5fe760aa6ae62a6ca05d3675384fc7 Mon Sep 17 00:00:00 2001 From: nakjun <111031253+nakjun12@users.noreply.github.com> Date: Tue, 28 May 2024 09:28:02 +0900 Subject: [PATCH 1/2] Handle array input for --type in parseRequestedNames --- scripts/rollup/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index df9fb00b09424..38bbfcadd9b38 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -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; From 19368732406ad23ffca05884c2a34ebc0a767b08 Mon Sep 17 00:00:00 2001 From: nakjun <111031253+nakjun12@users.noreply.github.com> Date: Wed, 29 May 2024 00:04:45 +0900 Subject: [PATCH 2/2] Fix bundleType filtering logic to correctly handle array input in requestedBundleTypes --- scripts/rollup/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 38bbfcadd9b38..535e055cdeb78 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -530,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;