From 4f71a9b87397988b41438d4e622f25a811d4bb5d Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Tue, 7 Jan 2025 23:29:49 -0500 Subject: [PATCH] Add null check on Parcel Bundles --- .scripts/assets-build-tool/build.mjs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.scripts/assets-build-tool/build.mjs b/.scripts/assets-build-tool/build.mjs index 5421801ea5c..a23984ae02b 100755 --- a/.scripts/assets-build-tool/build.mjs +++ b/.scripts/assets-build-tool/build.mjs @@ -81,11 +81,6 @@ if (task === "build" || task === "watch") { groups = groups.filter((g) => !g.bundleEntrypoint); if (parcelGroupsByBundle) { - console.log( - chalk.yellow("Building Parcel bundles: "), - _.keys(parcelGroupsByBundle).join(", ") - ); - const entries = []; // loop through each bundle and generate the new combined group _.forEach(parcelGroupsByBundle, (value, bundleEntrypoint) => { @@ -103,12 +98,19 @@ if (task === "build" || task === "watch") { }); const parcelBundleOutput = buildConfig("parcelBundleOutput"); - groups.push({ - action: "parcel", - name: `orchardcore-bundle`, - source: entries, - dest: parcelBundleOutput, - }); + if (entries.length > 0) { + console.log( + chalk.yellow("Building Parcel bundles: "), + _.keys(parcelGroupsByBundle).join(", ") + ); + + groups.push({ + action: "parcel", + name: `orchardcore-bundle`, + source: entries, + dest: parcelBundleOutput, + }); + } } } @@ -232,8 +234,7 @@ if (gulpBuildStr != undefined && gulpRebuildStr == undefined) { name: "gulp build", command: `gulp build`, }); -} -else if (gulpBuildStr != undefined && gulpRebuildStr != undefined) { +} else if (gulpBuildStr != undefined && gulpRebuildStr != undefined) { buildProcesses.push({ order: 0, name: "gulp rebuild",