feat: pre-bundle plugin to dist/index.js to eliminate JITI startup latency#353
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/Martian-Engineering/lossless-claw/sessions/c7adcb86-c36a-4a9d-97d2-7c2be2576fdb Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
…TI startup latency Agent-Logs-Url: https://github.com/Martian-Engineering/lossless-claw/sessions/c7adcb86-c36a-4a9d-97d2-7c2be2576fdb Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix extreme CLI startup latency due to TS compilation
feat: pre-bundle plugin to dist/index.js to eliminate JITI startup latency
Apr 10, 2026
Add the bundle build step to the publish workflow so clean-checkout releases include dist/index.js before npm publish runs. This keeps the published tarball aligned with the new dist-based package entrypoints. Regeneration-Prompt: | The PR switched the package entrypoint and published files to dist/index.js, but the GitHub publish workflow still ran npm ci, npm test, then npm publish from a clean checkout. Address the release blocker with the smallest change: update the publish path so the bundle is built before publishing, without changing unrelated bundling behavior. Verify with the existing release check that the tarball includes dist/index.js.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenClaw's JITI loader re-transpiles every
.tsfile on each CLI invocation. Because lossless-claw ships raw TypeScript, this causes 15–25s startup delays for anyopenclawcommand while the plugin is installed.Changes
Build step: Adds
esbuild(devDependency) and abuildscript that bundlesindex.ts→dist/index.js(single 701kb ESM file, ~37ms build time). Runtime packages provided by the OpenClaw host (openclaw,@mariozechner/*) are externalized.Package entrypoints:
mainandopenclaw.extensionsupdated from./index.ts→./dist/index.js.Published files:
filesnow shipsdist/instead of raw.tssources; TypeScript source stays in the repo but is no longer distributed to NPM consumers.release:verify: Now runsnpm run buildbefore packing.Dockerfile: Removes|| trueguard — build is now deterministic.