fix(mod_custom): make base64ts bundle output deterministic and clean up generated temp sourcemaps

This commit is contained in:
2026-04-30 12:52:26 +00:00
parent 7f5de8797c
commit 3b2e0bebcd
5 changed files with 43 additions and 5 deletions
+7 -2
View File
@@ -9,7 +9,7 @@ const TEMP_DIR = '.nogit/tsbundle-temp';
export class CustomBundleHandler {
private cwd: string;
private config: interfaces.ITsbundleConfig;
private config!: interfaces.ITsbundleConfig;
constructor(cwd: string = paths.cwd) {
this.cwd = cwd;
@@ -54,7 +54,7 @@ export class CustomBundleHandler {
// Determine temp output path
const tempDir = plugins.path.join(this.cwd, TEMP_DIR);
const tempBundlePath = plugins.path.join(tempDir, `bundle-${Date.now()}.js`);
const tempBundlePath = plugins.path.join(tempDir, 'bundle.js');
// Ensure temp directory exists
await plugins.fs.directory(tempDir).create();
@@ -88,6 +88,11 @@ export class CustomBundleHandler {
if (tempFileExists) {
await plugins.fs.file(tempBundlePath).delete();
}
const tempSourceMapPath = `${tempBundlePath}.map`;
const tempSourceMapExists = await plugins.fs.file(tempSourceMapPath).exists();
if (tempSourceMapExists) {
await plugins.fs.file(tempSourceMapPath).delete();
}
}
/**