diff --git a/changelog.md b/changelog.md index a0a16a1..e10f007 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-01-23 - 2.8.2 - fix(mod_output) +resolve absolute and relative entry.path correctly when adding files + +- Add check for plugins.path.isAbsolute(entry.path) to avoid incorrectly joining absolute paths with dirPath +- Use entry.path directly when it's absolute, otherwise join with dirPath +- Ensures correct relativePath calculation and prevents invalid file reads + ## 2026-01-12 - 2.8.1 - fix(readme) document maxLineLength option for base64ts output and add example and tip diff --git a/cli.js b/cli.js old mode 100644 new mode 100755 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 075ddc9..7bf4989 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsbundle', - version: '2.8.1', + version: '2.8.2', description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects' } diff --git a/ts/mod_output/index.ts b/ts/mod_output/index.ts index abf70ee..28355ee 100644 --- a/ts/mod_output/index.ts +++ b/ts/mod_output/index.ts @@ -56,7 +56,10 @@ export class Base64TsOutput { for (const entry of entries) { if (!entry.isDirectory && regex.test(entry.name)) { - const fullPath = plugins.path.join(dirPath, entry.path); + // entry.path may be absolute or relative - handle both cases + const fullPath = plugins.path.isAbsolute(entry.path) + ? entry.path + : plugins.path.join(dirPath, entry.path); const relativePath = plugins.path.relative(this.cwd, fullPath); const content = await plugins.fs.file(fullPath).read(); this.addFile(relativePath, content);