-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
docs: use webpack serve
instead webpack-dev-server
#4091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, automatically used when it is supported
webpack-dev-server --socket socket | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed without replacement
|
||
```bash | ||
webpack-dev-server --hot-only | ||
webpack serve --hot only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--hot-only
seems correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 --hot
webpack serve --no-hot
webpack serve --hot=only
orwebpack serve --hot only
(both supported)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Thanks! |
fixes webpack/webpack-cli#1602 (comment)
fixes #4095