docs(experiments): document experiments.typescript (5.107)#8247
Merged
Conversation
Webpack 5.107 adds first-class TypeScript support behind a new experiments.typescript flag using Node.js's built-in module.stripTypeScriptTypes (Node.js >= 22.6). Documents: - The flag itself (boolean, default false, auto-enabled by experiments.futureDefaults). - The defaults it wires up (rules, extension resolution, extensionAlias, tsconfig resolution, "typescript" conditional-exports key). - The constraints: types-only transform, no type checking, no JSX/.tsx, no non-erasable syntax (enum, namespace, etc.), matching tsconfig's erasableSyntaxOnly. - Links to examples/typescript and examples/typescript-non-erasable in the webpack repo for both the built-in setup and the ts-loader fallback. Refs: webpack/webpack#20964
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
alexander-akait
previously approved these changes
May 19, 2026
Member
|
@bjohansebas let's rebase and we can merge, thanks |
evenstensberg
previously approved these changes
May 20, 2026
Member
|
could you rebase? |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation for webpack 5.107’s new experimental TypeScript support behind experiments.typescript, explaining what gets enabled by default, the feature’s constraints, and pointing to upstream examples.
Changes:
- Adds
experiments.typescriptto the experiments option list/TOC. - Documents the new
experiments.typescriptflag, including defaults it wires up (rules, resolution, extensionAlias, tsconfig, conditional exports). - Adds a warning callout describing “types-erasure only” limitations and recommended tooling alternatives.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
Summary
Webpack 5.107 adds first-class TypeScript support behind a new
experiments.typescriptflag using Node.js's built-inmodule.stripTypeScriptTypes(Node.js >= 22.6).Documents:
boolean, defaultfalse, auto-enabled byexperiments.futureDefaults)..ts/.cts/.mts,.tsin extension resolution,extensionAliasfrom.js/.cjs/.mjsto the matching.tsextensions,tsconfig.jsonresolution, and the"typescript"conditional-exports key..tsx, no non-erasable syntax likeenum/namespace/ parameter-property constructors), matching tsconfig'serasableSyntaxOnly.examples/typescriptandexamples/typescript-non-erasablefor the built-in setup and thets-loaderfallback.Refs: webpack/webpack#20964
Test plan
### experiments.typescriptsectionUse of AI
Drafted with Claude under human review. The contributor verified each change against the upstream webpack PR before commit.