• Version 5.0.0
  • Published
  • 7.33 kB
  • 3 dependencies
  • MIT license


npm i @types/webpack-dev-middleware
yarn add @types/webpack-dev-middleware
pnpm add @types/webpack-dev-middleware


TypeScript definitions for webpack-dev-middleware



function WebpackDevMiddleware

WebpackDevMiddleware: (
compiler: webpack.Compiler | webpack.MultiCompiler,
options?: WebpackDevMiddleware.Options
) => WebpackDevMiddleware.WebpackDevMiddleware & NextHandleFunction;


    interface Context

    interface Context {}

      property callbacks

      callbacks: Callback[];

        property compiler

        compiler: webpack.Compiler;

          property options

          options: Options;

            property state

            state: boolean;

              property stats

              stats: webpack.Stats | null;

                property watching

                watching: webpack.Watching | null;

                  interface HeadersHandle

                  interface HeadersHandle {}

                    call signature

                    (req: IncomingMessage, res: ServerResponse, context: Context): Record<
                    > | void;

                      interface MimeTypeMap

                      interface MimeTypeMap {}

                        index signature

                        [type: string]: string;

                          interface Options

                          interface Options {}

                            property headers

                            headers?: Record<string, string> | HeadersHandle;
                            • This property allows a user to pass custom HTTP headers on each request. eg. { "X-Custom-Header": "yes" }

                            property index

                            index?: string | boolean;
                            • The index path for web server, defaults to "index.html". If falsy (but not undefined), the server will not respond to requests to the root URL.

                            property methods

                            methods?: string[];
                            • This property allows a user to pass the list of HTTP request methods accepted by the server. [ 'GET', 'HEAD' ]

                            property mimeTypes

                            mimeTypes?: MimeTypeMap;
                            • This property allows a user to register custom mime types or extension mappings

                            property outputFileSystem

                            outputFileSystem?: webpack.Compiler['outputFileSystem'];
                            • Set the default file system which will be used by webpack as primary destination of generated files

                            property publicPath

                            publicPath?: string;
                            • The public path that the middleware is bound to

                            property serverSideRender

                            serverSideRender?: boolean;
                            • Instructs the module to enable or disable the server-side rendering mode

                            property stats

                            stats?: webpack.Configuration['stats'];
                            • Stats options object or preset name.

                            property writeToDisk

                            writeToDisk?: boolean | ((filename: string) => boolean);
                            • If true, the option will instruct the module to write files to the configured location on disk as specified in your webpack config file This option also accepts a Function value, which can be used to filter which files are written to disk

                            interface WebpackDevMiddleware

                            interface WebpackDevMiddleware {}

                              property context

                              context: Context;

                                method close

                                close: (callback?: () => void) => void;
                                • A function executed once the middleware has stopped watching.

                                method getFilenameFromUrl

                                getFilenameFromUrl: (url: string) => string | undefined;
                                • Get filename from URL.

                                  Parameter url

                                  URL for the requested file.

                                method invalidate

                                invalidate: (callback?: Callback) => void;
                                • Instructs a webpack-dev-middleware instance to recompile the bundle. e.g. after a change to the configuration.

                                method waitUntilValid

                                waitUntilValid: (callback?: Callback) => void;
                                • Executes a callback function when the compiler bundle is valid, typically after compilation

                                Type Aliases

                                type Callback

                                type Callback = (stats?: webpack.Stats) => void;

                                  Package Files (1)

                                  Dependencies (3)

                                  Dev Dependencies (0)

                                  No dev dependencies.

                                  Peer Dependencies (0)

                                  No peer dependencies.


                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/webpack-dev-middleware.

                                  • Markdown
                                  • HTML
                                    <a href="https://www.jsdocs.io/package/@types/webpack-dev-middleware"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>