Skip to content

Commit

Permalink
Wait 10s in TGS build for ESBuild to exit
Browse files Browse the repository at this point in the history
Workaround for ESBuild lingering until privatenumber/esbuild-loader#354 is merged
  • Loading branch information
Cyberboss committed Jan 16, 2024
1 parent 1fe875b commit a0e46cb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tools/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import Juke from './juke/index.js';
import { DreamDaemon, DreamMaker, NamedVersionFile } from './lib/byond.js';
import { yarn } from './lib/yarn.js';

const TGS_MODE = process.env.CBT_BUILD_MODE === 'TGS';

Juke.chdir('../..', import.meta.url);
Juke.setup({ file: import.meta.url }).then((code) => {
// We're using the currently available quirk in Juke Build, which
Expand All @@ -21,7 +23,15 @@ Juke.setup({ file: import.meta.url }).then((code) => {
Juke.logger.error('Please inspect the error and close the window.');
return;
}
process.exit(code);

if (TGS_MODE) {
// workaround for ESBuild process lingering
// Once https://github.com/privatenumber/esbuild-loader/pull/354 is merged and updated to, this can be removed
setTimeout(() => process.exit(code), 10000);
}
else {
process.exit(code);
}
});

const DME_NAME = 'tgstation';
Expand Down Expand Up @@ -470,6 +480,5 @@ export const TgsTarget = new Juke.Target({
},
});

const TGS_MODE = process.env.CBT_BUILD_MODE === 'TGS';

export default TGS_MODE ? TgsTarget : BuildTarget;

0 comments on commit a0e46cb

Please sign in to comment.