fix(build): exclude deprecated .worker.ts entrypoints from AMD build - #5481
Open
Michael Doyle (MichaelDoyle) wants to merge 1 commit into
Open
Michael Doyle (MichaelDoyle) wants to merge 1 commit into
Michael Doyle (MichaelDoyle) wants to merge 1 commit into
Conversation
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.
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.
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.