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)
And if I want to use react-hot-loader, is the webpack-dev-server necessary? Nope, it works on top of Webpack's hot module replacement interface. You can create your own 'hot server' if you want.
There are some alternatives to Webpack that provide the same functionality as webpack. These alternatives are gulp, babel, parcel, browserify, grunt, npm, and requireJS.
webpack-dev-server serves bundled files from the directory defined in output. path , i.e., files will be available under http://[devServer.host]:[devServer.port]/[output.publicPath]/[output.filename]
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With