Skip to content

chore(package): shrink the packaged VSIX from ~29 MB to ~14 MB - #1152

Merged
ggrossetie merged 1 commit into
asciidoctor:mainfrom
ggrossetie:chore/shrink-vsix-package
Jul 7, 2026
Merged

chore(package): shrink the packaged VSIX from ~29 MB to ~14 MB#1152
ggrossetie merged 1 commit into
asciidoctor:mainfrom
ggrossetie:chore/shrink-vsix-package

Conversation

@ggrossetie

Copy link
Copy Markdown
Member

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.

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>
@ggrossetie
ggrossetie merged commit 20aa6d0 into asciidoctor:main Jul 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant