Skip to content

fix(build): exclude deprecated .worker.ts entrypoints from AMD build - #5481

Open
Michael Doyle (MichaelDoyle) wants to merge 1 commit into
microsoft:mainfrom
MichaelDoyle:md/exclude-duplicate-amd-workers
Open

Michael Doyle (MichaelDoyle) wants to merge 1 commit into
microsoft:mainfrom
MichaelDoyle:md/exclude-duplicate-amd-workers

Conversation

@MichaelDoyle

@MichaelDoyle Michael Doyle (MichaelDoyle) commented Sep 17, 2026

Copy link
Copy Markdown

We noticed a big jump in bundle size in 0.56 (+1.87 MB zipped / +8.32 MB). This seems like the right fix, but if not let me know.


In 0.56.0 (#5155), deprecated .worker.ts shims (src/deprecated/language/typescript/ts.worker.ts, etc.) were added to getEntryPoints() in build/shared.mjs to preserve legacy ESM import paths for monaco-editor-webpack-plugin.

Because getEntryPoints() is shared between the ESM and AMD builds, Vite's AMD build compiles those shims into full standalone AMD worker modules under min/vs/language/ (7.7 MB) and dev/vs/language/ (14.3 MB), even though Vite's worker plugin already emits the actual IIFE web workers into vs/assets/*.worker-[hash].js.

Add includeDeprecatedWorkers (defaulting to includeFeatures) to getEntryPoints() so the AMD build excludes those ESM-only shims, reducing the published monaco-editor package size by 21.9 MB uncompressed.

In 0.56.0 (microsoft#5155), deprecated .worker.ts shims (src/deprecated/language/typescript/ts.worker.ts, etc.) were added to getEntryPoints() in build/shared.mjs to preserve legacy ESM import paths for monaco-editor-webpack-plugin.

Because getEntryPoints() is shared between the ESM and AMD builds, Vite's AMD build compiles those shims into full standalone AMD worker modules under min/vs/language/ (7.7 MB) and dev/vs/language/ (14.3 MB), even though Vite's worker plugin already emits the actual IIFE web workers into vs/assets/*.worker-[hash].js.

Add includeDeprecatedWorkers (defaulting to includeFeatures) to getEntryPoints() so the AMD build excludes those ESM-only shims, reducing the published monaco-editor package size by 21.9 MB uncompressed.
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