chore(package): shrink the packaged VSIX from ~29 MB to ~14 MB - #1152
Merged
Conversation
Exclude artifacts that are never loaded at runtime, roughly halving the VSIX (3825 -> 2503 files, ~29 MB -> ~14 MB). Rework `.vscodeignore` around how `vsce` collects files: it already ships only production dependencies, and it splits patterns into an ignore and a negate (`!`) list where the negate always wins regardless of order. A broad `!node_modules/`/`!syntaxes/` therefore re-included the whole subtree and later ignores had no effect. Narrow the re-includes so `syntaxes/` ships only the registered grammar and `node_modules/` ships only the runtime file types (dropping bundled `.ts` sources, source maps, docs and linter/test config, plus the `syntaxes/tests` snapshot fixtures). Filter the Mermaid bundle in `tasks/copy-mermaid.mjs`: keep the ESM entry and its lazily loaded `.mjs` chunks, drop the TypeScript declarations, source maps (~51 MB alone) and unused UMD builds, taking `media/mermaid` from ~76 MB to ~15 MB. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Exclude artifacts that are never loaded at runtime, roughly halving the VSIX (3825 -> 2503 files, ~29 MB -> ~14 MB).
Rework
.vscodeignorearound howvscecollects files: it already ships only production dependencies, and it splits patterns into an ignore and a negate (!) list where the negate always wins regardless of order. A broad!node_modules//!syntaxes/therefore re-included the whole subtree and later ignores had no effect. Narrow the re-includes sosyntaxes/ships only the registered grammar andnode_modules/ships only the runtime file types (dropping bundled.tssources, source maps, docs and linter/test config, plus thesyntaxes/testssnapshot fixtures).Filter the Mermaid bundle in
tasks/copy-mermaid.mjs: keep the ESM entry and its lazily loaded.mjschunks, drop the TypeScript declarations, source maps (~51 MB alone) and unused UMD builds, takingmedia/mermaidfrom ~76 MB to ~15 MB.