webpack-watch-server
v1.2.1
Published
A single npm script command to start Webpack and your server in watch mode, with a unified console.
Downloads
355
Readme
Webpack watch server
A single webpack-watch-server
command to add to your package scripts that fires up Webpack in watch mode and restarts your server each build. Webpack and server logs stream in a unified console with clear formatting and pretty colors.
By using a Webpack build callback under the hood, this package is much more efficient than using a seperate watcher (such as Nodemon or Forever) to restart the server.
Install
With npm:
npm install webpack-watch-server
Usage
- Add
"dev": "webpack-watch-server"
to yourpackage.json
scripts. To specify a custom Webpack config file path usewebpack-watch-server --config path/to/custom-webpack-config.js
. The file will be transpiled with Babel if it’s name ends with.config.babel.js
. - Run
npm run dev
to start Webpack in watch mode. The server automatically starts and restarts after each build.
Caveats
- It is assumed your server file is the default Node finds at the Webpack config
output.path
–index.js
works. - For now, only plain object Webpack configs are supported.
Support
- Node >= 6.4.