Skip to content

Commit 4547dbb

Browse files
authored
Merge pull request #13011 from CesiumGS/fix-sandcastle-deployment
Fix gallery build for prod
2 parents 8f923ed + 26bb727 commit 4547dbb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/buildSandcastle.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,25 @@ export async function buildSandcastleApp({
134134

135135
await buildStatic(config);
136136
// Build the gallery after sandcastle to avoid clobbering the files
137-
await buildSandcastleGallery({ includeDevelopment });
137+
await buildSandcastleGallery({
138+
includeDevelopment,
139+
outputDir: outputToBuildDir
140+
? "../../Build/Sandcastle2"
141+
: "../../Apps/Sandcastle2",
142+
});
138143
}
139144

140145
/**
141146
* Indexes Sandcastle gallery files and writes gallery files to the configured Sandcastle output directory.
142147
* @param {object} options
143148
* @param {boolean} options.includeDevelopment true if gallery items flagged as development should be included.
149+
* @param {string} [options.outputDir] change the directory the gallery is built to. Defaults to /Apps/Sandcastle2
144150
* @returns {Promise<void>} A promise that resolves once the gallery files have been indexed and written.
145151
*/
146-
export async function buildSandcastleGallery({ includeDevelopment }) {
152+
export async function buildSandcastleGallery({
153+
includeDevelopment,
154+
outputDir = "../../Apps/Sandcastle2",
155+
}) {
147156
const { configPath, root, gallery, sourceUrl } = await getSandcastleConfig();
148157

149158
// Use an absolute path to avoid any descrepency between working directories
@@ -163,7 +172,7 @@ export async function buildSandcastleGallery({ includeDevelopment }) {
163172

164173
await buildGalleryList({
165174
rootDirectory,
166-
publicDirectory: "../../Apps/Sandcastle2",
175+
publicDirectory: outputDir,
167176
galleryFiles,
168177
sourceUrl,
169178
defaultThumbnail,

0 commit comments

Comments
 (0)