14

I've noticed that installing webpack-dev-server@webpack/webpack#next actually installs webpack (without any warning). However, there's no webpack-dev-server executable any more.

Is there a replacement for this in Webpack 4, or do I need a separate web server?

It was really convenient to quickly spin up a web server with hot reloading. What's the recommended way to do that in Webpack 4?

(Why I'm bothering with Webpack 4 at all? Because it supports native .mjs modules)

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
  • Isn't GH issue a better place for webpack 4 questions since it's still in beta state? – Allen Feb 02 '18 at 04:51
  • @Xlee: perhaps, but asking these sorts of questions, as opposed to filing bug reports, usually get me sent elsewhere from [many](https://github.com/nodejs/node/issues/18001#issuecomment-355525409) OSS [projects'](https://github.com/influxdata/influxdb/issues/7850#issuecomment-273263540) repos. – Dan Dascalescu Feb 02 '18 at 07:37
  • 2
    After spending the last 12 hours attempting to upgrade from Webpack 3 -> 4 (with the help of 50+ blog posts and GH issues), I would suggest anyone else who is considering for new ways to torture themselves to be happy that their tool-chain is working and turn back. Dependency hell doesn't begin to describe what awaits. – Damien Roche Mar 25 '18 at 07:25

2 Answers2

6

Today were released webpack v4.0.0 and webpack-dev-server v3.0.0

Just as Shaknar said, you just need to install the latest versions (including webpack-cli):

yarn add webpack webpack-cli webpack-dev-server --dev

You can also check this webpack-demo project I made for a meetup last week.

Carloluis
  • 4,205
  • 1
  • 20
  • 25
3

you need to install webpack-dev-server@next , webpack-cli and webpack@next to run webpack 4 for now when it will be released you dont need @next to install latest version

Tripurari Shankar
  • 3,308
  • 1
  • 15
  • 24
  • Turns out `yarn add webpack-dev-server@next webpack@next` is sufficient, but Webpack's GitHub repo says [webpack-dev-server is in maintenance mode](https://github.com/webpack/webpack-dev-server#project-in-maintenance). Will it actually be released for Webpack 4, or is it being abandoned? – Dan Dascalescu Feb 02 '18 at 07:34
  • Fwiw, it looks like people are talking about this, but I couldn't find anything specifically promised. https://github.com/webpack/webpack-dev-server/issues/1295 and https://github.com/webpack/webpack-dev-server/pull/1243 – jess Feb 04 '18 at 18:17
  • 3
    What a mess. I'm going back to webpack 3 and not upgrading for the rest of my life. – Damien Roche Mar 25 '18 at 07:12