Compare commits

..

4 Commits

Author SHA1 Message Date
0900d1a605 v2.8.2
Some checks failed
Default (tags) / security (push) Successful in 39s
Default (tags) / test (push) Failing after 37s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-01-23 19:08:55 +00:00
f0fb99c8ae fix(mod_output): resolve absolute and relative entry.path correctly when adding files 2026-01-23 19:08:55 +00:00
6d88adcd1e v2.8.1
Some checks failed
Default (tags) / security (push) Successful in 40s
Default (tags) / test (push) Failing after 34s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-01-12 02:03:38 +00:00
4349571112 fix(readme): document maxLineLength option for base64ts output and add example and tip 2026-01-12 02:03:38 +00:00
6 changed files with 25 additions and 4 deletions

View File

@@ -1,5 +1,19 @@
# Changelog # 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
- Add documented `maxLineLength` configuration option (number, default 0 = unlimited) for `base64ts` output.
- Include example config showing `maxLineLength: 200`.
- Add a tip recommending setting `maxLineLength` to split long base64 strings when using AI tools with line-length limits.
## 2026-01-12 - 2.8.0 - feat(tsbundle) ## 2026-01-12 - 2.8.0 - feat(tsbundle)
add configurable maxLineLength for base64ts output and improve build/error handling in child builds add configurable maxLineLength for base64ts output and improve build/error handling in child builds

0
cli.js Normal file → Executable file
View File

View File

@@ -1,6 +1,6 @@
{ {
"name": "@git.zone/tsbundle", "name": "@git.zone/tsbundle",
"version": "2.8.0", "version": "2.8.2",
"private": false, "private": false,
"description": "a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects", "description": "a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@@ -91,6 +91,7 @@ tsbundle uses `npmextra.json` for configuration. Here's an example:
| `bundler` | `"esbuild"` \| `"rolldown"` \| `"rspack"` | `"esbuild"` | Which bundler to use | | `bundler` | `"esbuild"` \| `"rolldown"` \| `"rspack"` | `"esbuild"` | Which bundler to use |
| `production` | `boolean` | `false` | Enable minification | | `production` | `boolean` | `false` | Enable minification |
| `includeFiles` | `string[]` | `[]` | Glob patterns for additional files (HTML, assets) | | `includeFiles` | `string[]` | `[]` | Glob patterns for additional files (HTML, assets) |
| `maxLineLength` | `number` | `0` (unlimited) | For `base64ts` mode: max chars per line in output |
### Output Modes ### Output Modes
@@ -108,6 +109,8 @@ export const files: { path: string; contentBase64: string }[] = [
]; ];
``` ```
**Tip:** If you're working with AI tools that have line length limitations, set `maxLineLength` (e.g., `200`) to split long base64 strings across multiple lines.
## Available Bundlers 🔧 ## Available Bundlers 🔧
tsbundle supports three modern bundlers: tsbundle supports three modern bundlers:
@@ -241,7 +244,8 @@ Config:
"outputMode": "base64ts", "outputMode": "base64ts",
"bundler": "esbuild", "bundler": "esbuild",
"production": true, "production": true,
"includeFiles": ["./html/index.html"] "includeFiles": ["./html/index.html"],
"maxLineLength": 200
} }
] ]
} }

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tsbundle', name: '@git.zone/tsbundle',
version: '2.8.0', version: '2.8.2',
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects' description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
} }

View File

@@ -56,7 +56,10 @@ export class Base64TsOutput {
for (const entry of entries) { for (const entry of entries) {
if (!entry.isDirectory && regex.test(entry.name)) { 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 relativePath = plugins.path.relative(this.cwd, fullPath);
const content = await plugins.fs.file(fullPath).read(); const content = await plugins.fs.file(fullPath).read();
this.addFile(relativePath, content); this.addFile(relativePath, content);