Skip to content

Commit

Permalink
Add null check on Parcel Bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt committed Jan 8, 2025
1 parent 119913b commit 4f71a9b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .scripts/assets-build-tool/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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,
});
}
}
}

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 4f71a9b

Please sign in to comment.