Skip to content

Conversation

alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented Oct 23, 2020

@vercel
Copy link

vercel bot commented Oct 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/nbrqnbjxx
✅ Preview: https://webpack-js-org-git-docs-fix-webpack-serve.webpack-docs.vercel.app

webpack-dev-server --color
```


Copy link
Member Author

@alexander-akait alexander-akait Oct 23, 2020

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
```


Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--hot-only seems correct

Copy link
Member Author

@alexander-akait alexander-akait Oct 23, 2020

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 or webpack serve --hot only (both supported)

Copy link
Member

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

Copy link
Member Author

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

@alexander-akait
Copy link
Member Author

alexander-akait commented Oct 26, 2020

/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",
Copy link
Member

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",

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@montogeek montogeek merged commit d58df37 into master Oct 28, 2020
@montogeek
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webpack Dev Server command deprecated Error: Cannot find module 'webpack-cli/bin/config-yargs'
5 participants