Skip to content

Commit

Permalink
Upgrade to latest config from webpack-dev-server v4.0.0-rc.0 (#310)
Browse files Browse the repository at this point in the history
* Upgrade to latest config from webpack-dev-server v4.0.0-rc.0

* Reinstate client host

* Update webpack-dev-server version

* Fix pnpm-lock.yaml for tests

* Try to fix tests

Co-authored-by: Joel Denning <joeldenning@gmail.com>
  • Loading branch information
alexristich and joeldenning authored Jul 21, 2021
1 parent 2c2d761 commit 5dc82a6
Show file tree
Hide file tree
Showing 8 changed files with 421 additions and 382 deletions.
9 changes: 9 additions & 0 deletions .changeset/calm-worms-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"webpack-config-single-spa": major
---

Upgrade to latest config from webpack-dev-server v4.0.0-rc.0

The [release candidate](https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-rc.0) introduced some breaking changes which prevented the local server from running in new applications created with `create-single-spa`.

This also simplfies the configuration to take advantage of new default values.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "15"
- uses: pnpm/action-setup@v1.2.1
node-version: "16"
- uses: pnpm/action-setup@v2.0.1
with:
version: 5.17.2
version: 6.10.2
- run: git checkout main && git checkout $GITHUB_SHA
- run: pnpm install --frozen-lockfile
- run: pnpx changeset status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2",
"webpack-config-single-spa-react": "^2.2.2",
"webpack-dev-server": "^4.0.0-beta.0",
"webpack-dev-server": "^4.0.0-rc.0",
"webpack-merge": "^5.8.0"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2",
"webpack-config-single-spa": "^2.2.1",
"webpack-dev-server": "^4.0.0-beta.0",
"webpack-dev-server": "^4.0.0-rc.0",
"webpack-merge": "^5.8.0"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"webpack-config-single-spa": "^2.2.1",
"webpack-merge": "^5.8.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.0.0-beta.0"
"webpack-dev-server": "^4.0.0-rc.0"
},
"dependencies": {
"@types/jest": "^26.0.23",
Expand Down
2 changes: 1 addition & 1 deletion packages/single-spa-welcome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2",
"webpack-config-single-spa-react": "workspace:*",
"webpack-dev-server": "^4.0.0-beta.0",
"webpack-dev-server": "^4.0.0-rc.0",
"webpack-merge": "^5.8.0"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,16 @@ function webpackConfigSingleSpa(opts) {
},
devtool: "source-map",
devServer: {
compress: true,
historyApiFallback: true,
headers: {
"Access-Control-Allow-Origin": "*",
},
firewall: false,
client: {
host: "localhost",
webSocketURL: {
hostname: "localhost",
},
},
allowedHosts: "all",
},
externals: opts.orgPackagesAsExternal
? ["single-spa", new RegExp(`^@${opts.orgName}/`)]
Expand Down
Loading

0 comments on commit 5dc82a6

Please sign in to comment.