webpack-dev-server-waitpage provides a visual progress page for `webpack-dev-server`, displaying compilation status to users instead of a blank screen during development. It is currently at version 3.0.0, offering compatibility with modern Node.js environments and Webpack 5. The package aims to improve developer experience by offering immediate visual feedback on the build process. It differentiates itself through customizable themes (default, dark, material) and support for custom EJS templates, allowing developers to brand or tailor the waiting experience. The library functions as both a Webpack plugin and a `webpack-dev-server` middleware, supporting multiple Webpack configurations. Release cadence is driven primarily by updates to Webpack and `webpack-dev-server` itself, ensuring continued compatibility.
npm install webpack-dev-server-waitpageVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `webpack-dev-server-waitpage` into a TypeScript Webpack 5 project. It shows adding both the plugin to the `plugins` array and the middleware to the `devServer.onBeforeSetupMiddleware` hook, configured with a 'material' theme and custom title.
For `webpack-dev-server` v4+, use `devServer: { onBeforeSetupMiddleware: (server) => { server.app.use(webpackDevServerWaitpage(server, options)); } }`. For `webpack-dev-server` v3, use `devServer: { before: (app, server) => { app.use(webpackDevServerWaitpage(server, options)); } }`.Consult the usage section of the README for your specific version. Current versions (>=1.0.0) require both `webpackDevServerWaitpage.plugin()` in the `plugins` array and `app.use(webpackDevServerWaitpage(server, options))` in the `devServer` middleware hook.
Set `disableWhenValid: false` in the options object passed to the middleware: `server.app.use(webpackDevServerWaitpage(server, { disableWhenValid: false }));`Correctly pass the `server` object: `server.app.use(webpackDevServerWaitpage(server, options));` (v4+) or `app.use(webpackDevServerWaitpage(server, options));` (v3).
Upgrade to `webpack-dev-server-waitpage` version 2.1.1 or higher to resolve this specific bug.
Ensure you are using `import webpackDevServerWaitpage from 'webpack-dev-server-waitpage';` and then invoking it correctly as `webpackDevServerWaitpage(server, options)` for the middleware or `webpackDevServerWaitpage.plugin()` for the plugin. For CommonJS, use `const webpackDevServerWaitpage = require('webpack-dev-server-waitpage');`.Adjust your `webpack.config.js` to use the correct `devServer` hook for your `webpack-dev-server` version: `onBeforeSetupMiddleware` for v4+ or `before` for v3.