docs: use webpack serve instead webpack-dev-server#4091
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/nbrqnbjxx |
| webpack-dev-server --color | ||
| ``` | ||
|
|
||
|
|
There was a problem hiding this comment.
Removed, automatically used when it is supported
| webpack-dev-server --socket socket | ||
| ``` | ||
|
|
||
|
|
There was a problem hiding this comment.
Removed without replacement
|
|
||
| ```bash | ||
| webpack-dev-server --hot-only | ||
| webpack serve --hot only |
There was a problem hiding this comment.
To be honestly we don't support this yet (regression), I am working on it, but --hot can be boolean or string, so we should supported:
webpack serve --hotwebpack serve --no-hotwebpack serve --hot=onlyorwebpack serve --hot only(both supported)
There was a problem hiding this comment.
I see, though the option in devServer config object says hotOnly - https://webpack.js.org/configuration/dev-server/#devserverhotonly
This means we'll have to change/remove it's flag on webpack-dev-server? - https://github.com/webpack/webpack-dev-server/blob/98aa8e1f385b4e5d74ee097fa60362802cda505e/bin/cli-flags.js#L53
There was a problem hiding this comment.
Yes, we need to to do it
|
/cc @chenxsan Can you review and merge? (a lot of issues 😞 ) |
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "watch": "webpack --watch", | ||
| + "start": "webpack-dev-server --open", | ||
| + "start": "webpack serve --open", |
There was a problem hiding this comment.
I got error error: option '--open <value>' argument missing, am I missing something?
Here's the versions:
"webpack": "^5.2.0",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0",
There was a problem hiding this comment.
Bug, I will fix it in the near future, but it will work
|
|
||
| ```bash | ||
| webpack-dev-server --entry /entry/file --output-path /output/path --allowed-hosts .host.com,host2.com | ||
| webpack serve --entry ./entry/file --output-path /output/path --allowed-hosts .host.com,host2.com |
There was a problem hiding this comment.
| webpack serve --entry ./entry/file --output-path /output/path --allowed-hosts .host.com,host2.com | |
| webpack serve --entry ./entry/file --output-path ./output/path --allowed-hosts .host.com,host2.com |
Can we use relative path for --output-path just like --entry? I think it's more reasonable as we're dealing with the current working directory.
|
Thanks! |
fixes webpack/webpack-cli#1602 (comment)
fixes #4095