fix(mod_custom): make base64ts bundle output deterministic and clean up generated temp sourcemaps
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsbundle',
|
||||
version: '2.10.0',
|
||||
version: '2.10.1',
|
||||
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user