Skip to content

Commit 3664b9d

Browse files
authored
chore: update webpack-dev-server to v6 and test against v5 and v6 (#4834)
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`.
1 parent ce1a219 commit 3664b9d

11 files changed

Lines changed: 4036 additions & 868 deletions

File tree

‎.changeset/dev-server-6-types.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-cli": patch
3+
---
4+
5+
fix: resolve the `webpack-dev-server` type from its default export, so the types work with both v5 and v6

‎.github/workflows/nodejs.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
os: [ubuntu-latest, windows-latest, macos-latest]
6464
node-version: [20.x, 22.x, 24.x, 25.x, 26.x]
6565
webpack-version: [latest]
66-
dev-server-version: [latest]
66+
dev-server-version: [5, latest]
6767

6868
steps:
6969
- name: Checkout code
@@ -85,6 +85,10 @@ jobs:
8585
- name: Install dependencies
8686
run: npm ci --ignore-scripts
8787

88+
- name: Install webpack-dev-server ${{ matrix.dev-server-version }}
89+
if: matrix.dev-server-version == '5'
90+
run: npm install webpack-dev-server@${{ matrix.dev-server-version }} --no-save --ignore-scripts
91+
8892
- name: Prepare environment for tests
8993
run: npm run build -- --sourceMap true
9094

0 commit comments

Comments
 (0)