Skip to content

docs(experiments): document experiments.typescript (5.107)#8247

Open
bjohansebas wants to merge 1 commit into
mainfrom
docs/experiments-typescript
Open

docs(experiments): document experiments.typescript (5.107)#8247
bjohansebas wants to merge 1 commit into
mainfrom
docs/experiments-typescript

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

Summary

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 wired up automatically: rules for .ts / .cts / .mts, .ts in extension resolution, extensionAlias from .js / .cjs / .mjs to the matching .ts extensions, tsconfig.json resolution, and the "typescript" conditional-exports key.
  • The constraints (types-only transform; no type checking, no JSX/.tsx, no non-erasable syntax like enum / namespace / parameter-property constructors), matching tsconfig's erasableSyntaxOnly.
  • Links to examples/typescript and examples/typescript-non-erasable for the built-in setup and the ts-loader fallback.

Refs: webpack/webpack#20964

Test plan

  • Visual check of the new ### experiments.typescript section
  • Verify the TOC entry links correctly
  • Verify the warning admonition is visible
  • Verify the badge shows "5.107.0+"

Use of AI

Drafted with Claude under human review. The contributor verified each change against the upstream webpack PR before commit.

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
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment May 19, 2026 2:54pm

Request Review

@alexander-akait
Copy link
Copy Markdown
Member

@bjohansebas let's rebase and we can merge, thanks

@evenstensberg
Copy link
Copy Markdown
Member

could you rebase?

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.

3 participants