Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve from a separate build folder during development #10843

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.vscode
/Apps
/Build/Apps
/Build/CesiumDev
/Build/Coverage
/Build/minifyShaders.state
/Build/Documentation
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ async function deployCesium(bucketName, uploadDirectory, cacheControl, dryRun) {
[
"Apps/**",
"Build/**",
"!Build/CesiumDev/**",
"Source/**",
"Specs/**",
"ThirdParty/**",
Expand Down
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const specFiles = [
const shaderFiles = ["Source/Shaders/**/*.glsl"];
const workerSourceFiles = ["Source/WorkersES6/*.js"];

const outputDirectory = path.join("Build", "CesiumUnminified");
const outputDirectory = path.join("Build", "CesiumDev");

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

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

function getRemoteUrlFromParam(req) {
Expand Down