webpack-plugin-serve is a fast and lean development server implemented as a Webpack plugin, offering an alternative to webpack-dev-server. It integrates directly into the Webpack compilation process, which can simplify configuration. The current stable version, 1.6.0, supports Webpack 4 and 5, and Node.js Active LTS versions (>=10.0.0, with a specific range for 10.x). The project appears to have a consistent release cadence with regular bugfixes and features, often including dependency updates. Key differentiators include its plugin-based architecture, focus on being 'evergreen' with Node.js support, and a comprehensive feature grid for comparison with alternatives. It emphasizes flexibility, allowing many features typically found in a dev server to be implemented via middleware. It ships with a client script that supports modern browsers (async/await) but can be transpiled for older ones. This plugin is often used in conjunction with `webpack-nano` for a minimal CLI experience.
npm install webpack-plugin-serveVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up `webpack-plugin-serve` with basic HMR, live-reloading, static file serving, and history fallback for SPAs. It uses an environment variable for the port and sets up typical entry/output paths.
Upgrade Node.js to an Active LTS version (v10.0.0+ for current versions of the plugin). Refer to the Node.js release schedule for supported versions.
Review the documentation for the `static` option and adopt the new option format, especially if using globs or an array of paths. The new format is typically an object specifying a `glob` property for patterns.
For older browser support, configure Babel with an appropriate Webpack loader to transpile the client script. The `webpack-plugin-serve/client` entry point should be processed by your Babel loader.
Add `'webpack-plugin-serve/client'` to your `entry` array in `webpack.config.js`. Ensure it's listed before your application's main entry file.
Set `watch: true` in your `module.exports` object within `webpack.config.js`.
Verify that `client.address` in your `WebpackPluginServe` options matches the server's actual address and port, and that `client.protocol` (default 'ws') is correct for your setup (e.g., 'wss' for HTTPS). Check firewall settings if running on a remote host.
Use the `client.address` option in the format `host:port` (e.g., `client: { address: 'localhost:8080' }`) instead of separate `host` and `port` properties within the `client` object.Upgrade Node.js to a version that is actively supported by the `webpack-plugin-serve` package. Check the `engines` field in the `package.json` or the README for the specific requirements.