Skip to content

chore: update webpack-dev-server to v6 and test against v5 and v6 - #4834

Open
bjohansebas wants to merge 1 commit into
mainfrom
chore/webpack-dev-server-6
Open

chore: update webpack-dev-server to v6 and test against v5 and v6#4834
bjohansebas wants to merge 1 commit into
mainfrom
chore/webpack-dev-server-6

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Summary

Updates the webpack-dev-server dev dependency to v6 and makes the test suite cover both v5 and v6, which are the versions the webpack-cli peer range allows (^5.0.0 || ^6.0.0).

  • Snapshots for dev-server 6 are added next to the existing v5 ones. The snapshot resolver already supports this through the .snap.devServer<major>.webpack<major> extension, so no tooling change was needed. The only difference in the output is the help text for --server-type, since v6 drops spdy from the possible values.
  • CI runs the matrix against dev-server-version: [5, latest], installing v5 with npm install ... --no-save --ignore-scripts for that job, following the same approach as chore: use plugin support #4791.
  • webpack-dev-server v6 is ESM and exposes the server as its default export, while v5 exports it directly, so tsc failed with "This expression is not constructable". The CLI now resolves the constructor type from the default export when there is one, which type-checks against both versions. Runtime behavior is unchanged: the package was already loaded through (await import(pkg)).default.

What kind of change does this PR introduce?

chore, plus a types fix in webpack-cli.

Did you add tests for your changes?

No new tests, the existing test/help and test/serve suites now run against both dev-server versions with their own snapshots.

Does this PR introduce a breaking change?

No. The peer range already allowed v6, and the type change only affects how the constructor type is resolved.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

SERVE-OPTIONS-v6.md will be generated by the scheduled "Update documentation" workflow, which derives the filename from the installed dev-server major.

Use of AI

Yes. I used Claude Code (Opus) to carry out the upgrade under my direction: the dependency bump, the type fix, the CI matrix and the snapshots. I verified the build and ran test/help against the new snapshots locally, and reviewed the final diff.

@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 946aeb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security

socket-security Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedwebpack-dev-server@​5.2.5 ⏵ 6.0.097 +1100 +310096 +2100

View full report

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (946aeb0).

Install it locally:

  • npm
npm i -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0
  • yarn
yarn add -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0
  • pnpm
pnpm add -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.34%. Comparing base (0cfc077) to head (946aeb0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4834      +/-   ##
==========================================
+ Coverage   93.32%   93.34%   +0.02%     
==========================================
  Files          14       14              
  Lines        5466     5472       +6     
  Branches      793      793              
==========================================
+ Hits         5101     5108       +7     
+ Misses        363      362       -1     
  Partials        2        2              
Files with missing lines Coverage Δ
packages/webpack-cli/src/webpack-cli.ts 96.78% <100.00%> (+0.03%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cfc077...946aeb0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Bump the dev dependency to `webpack-dev-server@6` and add snapshots for it,
which the snapshot resolver already supports through the
`.snap.devServer<major>.webpack<major>` extension. CI now runs the test matrix
against both v5 and v6, installing v5 with npm for that job.

`webpack-dev-server` v6 is ESM and exposes the server as its `default` export,
while v5 exports it directly, so the CLI now resolves the constructor type from
the default export when there is one. Runtime behavior is unchanged, the package
was already loaded through `(await import(pkg)).default`.
@bjohansebas
bjohansebas force-pushed the chore/webpack-dev-server-6 branch from 6cf3728 to 946aeb0 Compare August 22, 2026 21:16
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