Skip to content

build(vscode): minify release bundles and allowlist the VSIX contents - #24

Open
fi3ework wants to merge 1 commit into
mainfrom
build/minify-release-vsix-allowlist
Open

build(vscode): minify release bundles and allowlist the VSIX contents#24
fi3ework wants to merge 1 commit into
mainfrom
build/minify-release-vsix-allowlist

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

  • Two build modes, selected through rslib's --env-mode:
    • build:local / watch:local (--env-mode dev): readable output + source maps, so breakpoints in src/ bind in the dev host (the F5 playground task already uses watch:local).
    • build (CI and the Release workflow): minified, no source maps. extension.js goes from 1.4 MB (rslib's lightly-compressed default) to 577 kB; the darwin-arm64 VSIX packs to ~546 KB.
  • .vscodeignore is now an allowlist — dist/**/*.js, dist/**/*.node, icon, LICENSE, README, package.json — so source maps or anything else a local build leaves in dist/ never reach the VSIX. Verified: after a build:local, vsce ls lists no .map.
  • cross-env dropped; the mode travels as a CLI flag instead of an ad-hoc env var.

Related Links

N/A

Checklist

  • Tests updated (or not required). — pnpm lint && pnpm test:unit green; smoke, rstest and vscode E2E slices pass against the minified build.
  • Documentation updated (or not required).

Two build modes, selected through rslib's `--env-mode`: `build:local` /
`watch:local` (`--env-mode dev`) keep readable output with source maps so
breakpoints in `src/` bind in the dev host; plain `build` — what CI and the
Release workflow run — minifies and emits no source maps. Previously every
build shipped rslib's lightly-compressed default (1.4 MB `extension.js`);
the release bundle is now 577 kB.

`.vscodeignore` becomes an allowlist (`dist/**/*.js`, `dist/**/*.node`,
icon, LICENSE, README, package.json), so source maps or anything else a
local build leaves in `dist/` can never reach the VSIX.

`cross-env` is dropped: the env mode travels as a CLI flag.
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