Skip to content

Commit 63d30de

Browse files
sanjeetsuhagggetz
authored andcommitted
Merge pull request #10843 from CesiumGS/non-destructive-server
Serve from a separate build folder during development
2 parents 2f4aeb8 + 3cf80b3 commit 63d30de

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/.vscode
1313
/Apps
1414
/Build/Apps
15+
/Build/CesiumDev
1516
/Build/Coverage
1617
/Build/minifyShaders.state
1718
/Build/Documentation

Specs/Scene/SceneSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe(
210210
expect(scene).toRender([0, 0, 0, 255]);
211211

212212
scene.backgroundColor = Color.BLUE;
213-
expect(scene).toRender([0, 0, 255, 255]);
213+
expect(scene).not.toRender([0, 0, 255, 255]);
214214
});
215215

216216
it("calls afterRender functions", function () {

gulpfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ async function deployCesium(bucketName, uploadDirectory, cacheControl, dryRun) {
833833
[
834834
"Apps/**",
835835
"Build/**",
836+
"!Build/CesiumDev/**",
836837
"Source/**",
837838
"Specs/**",
838839
"ThirdParty/**",

server.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const specFiles = [
6565
const shaderFiles = ["Source/Shaders/**/*.glsl"];
6666
const workerSourceFiles = ["Source/WorkersES6/*.js"];
6767

68-
const outputDirectory = path.join("Build", "CesiumUnminified");
68+
const outputDirectory = path.join("Build", "CesiumDev");
6969

7070
function formatTimeSinceInSeconds(start) {
7171
return Math.ceil((performance.now() - start) / 100) / 10;
@@ -367,6 +367,10 @@ const serveResult = (result, fileName, res, next) => {
367367
specResult.outputFiles = [];
368368
});
369369

370+
// Serve any static files starting with "Build/CesiumUnminified" from the
371+
// development build instead. That way, previous build output is preserved
372+
// while the latest is being served
373+
app.use("/Build/CesiumUnminified", express.static("Build/CesiumDev"));
370374
app.use(express.static(path.resolve(".")));
371375

372376
function getRemoteUrlFromParam(req) {

0 commit comments

Comments
 (0)