Skip to content

Commit 027b635

Browse files
committed
Fixup makezip build
1 parent 4186da8 commit 027b635

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ async function pruneScriptsForZip(packageJsonPath) {
543543
delete scripts["build-ts"];
544544
delete scripts["build-third-party"];
545545
delete scripts["build-apps"];
546+
delete scripts["build-sandcastle"];
546547
delete scripts.clean;
547548
delete scripts.cloc;
548549
delete scripts["build-docs"];

scripts/build.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import gulp from "gulp";
1313
import { rimraf } from "rimraf";
1414

1515
import { mkdirp } from "mkdirp";
16-
import { buildGalleryList } from "../packages/sandcastle/scripts/buildGallery.js";
1716

1817
// Determines the scope of the workspace packages. If the scope is set to cesium, the workspaces should be @cesium/engine.
1918
// This should match the scope of the dependencies of the root level package.json.
@@ -628,6 +627,11 @@ export async function createGalleryList(noDevelopmentGallery) {
628627
metadata,
629628
} = gallery ?? {};
630629

630+
// Import asynchronously for now while this script is excluded from the release zip
631+
const { buildGalleryList } = await import(
632+
"../packages/sandcastle/scripts/buildGallery.js"
633+
);
634+
631635
await buildGalleryList({
632636
rootDirectory,
633637
publicDirectory: "../../Apps/Sandcastle2",

server.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
createIndexJs,
2020
buildCesium,
2121
} from "./scripts/build.js";
22-
import { buildGalleryList } from "./packages/sandcastle/scripts/buildGallery.js";
2322

2423
const argv = yargs(process.argv)
2524
.options({
@@ -274,11 +273,16 @@ async function generateDevelopmentBuild() {
274273
!!stats?.isFile() && !file.endsWith(".yml") && !file.endsWith(".yaml"),
275274
ignoreInitial: true,
276275
});
277-
galleryWatcher.on("all", async (event) => {
278-
if (event === "add" || event === "change" || event === "unlink") {
279-
await buildGalleryList(galleryDirectory);
280-
}
281-
});
276+
if (!production) {
277+
const { buildGalleryList } = await import(
278+
"./packages/sandcastle/scripts/buildGallery.js"
279+
);
280+
galleryWatcher.on("all", async (event) => {
281+
if (event === "add" || event === "change" || event === "unlink") {
282+
await buildGalleryList(galleryDirectory);
283+
}
284+
});
285+
}
282286

283287
// Rebuild jsHintOptions as needed and serve as-is
284288
app.get(

0 commit comments

Comments
 (0)