webpack-dev-middleware
- Version 7.4.2
- Published
- 136 kB
- 6 dependencies
- MIT license
Install
npm i webpack-dev-middleware
yarn add webpack-dev-middleware
pnpm add webpack-dev-middleware
Overview
A development middleware for webpack
Index
Functions
Type Aliases
- AdditionalMethods
- API
- Callback
- Close
- Compiler
- Configuration
- Context
- ExtendedServerResponse
- Extra
- FilledContext
- GetFilenameFromUrl
- HapiOptions
- HapiPlugin
- HapiPluginBase
- Headers
- IncomingMessage
- Invalidate
- Logger
- Middleware
- ModifyResponseData
- MultiCompiler
- MultiStats
- MultiWatching
- NextFunction
- NormalizedHeaders
- Options
- OutputFileSystem
- ReadStream
- ResponseData
- Schema
- ServerResponse
- Stats
- WaitUntilValid
- Watching
- WatchOptions
- WithOptional
- WithoutUndefined
Functions
function hapiWrapper
hapiWrapper: < HapiServer, HapiOptionsInternal extends HapiOptions>() => HapiPlugin<HapiServer, HapiOptionsInternal>;
HapiServer {HapiOptions} HapiOptionsInternal
Returns
{HapiPlugin<HapiServer, HapiOptionsInternal>}
function honoWrapper
honoWrapper: < RequestInternal extends any = any, ResponseInternal extends unknown = any>( compiler: Compiler | MultiCompiler, options?: Options<RequestInternal, ResponseInternal> | undefined) => (ctx: any, next: Function) => Promise<void> | void;
{IncomingMessage} [RequestInternal=IncomingMessage] {ServerResponse} [ResponseInternal=ServerResponse]
Parameter compiler
Parameter options
Returns
{(ctx: any, next: Function) => Promise | void}
function koaWrapper
koaWrapper: < RequestInternal extends any = any, ResponseInternal extends unknown = any>( compiler: Compiler | MultiCompiler, options?: Options<RequestInternal, ResponseInternal> | undefined) => (ctx: any, next: Function) => Promise<void> | void;
{IncomingMessage} [RequestInternal=IncomingMessage] {ServerResponse} [ResponseInternal=ServerResponse]
Parameter compiler
Parameter options
Returns
{(ctx: any, next: Function) => Promise | void}
function wdm
wdm: typeof wdm;
{IncomingMessage} [RequestInternal=IncomingMessage] {ServerResponse} [ResponseInternal=ServerResponse]
Parameter compiler
Parameter options
Returns
{API<RequestInternal, ResponseInternal>}
Type Aliases
type AdditionalMethods
type AdditionalMethods< RequestInternal extends IncomingMessage, ResponseInternal extends ServerResponse> = { getFilenameFromUrl: GetFilenameFromUrl; waitUntilValid: WaitUntilValid; invalidate: Invalidate; close: Close; context: Context<RequestInternal, ResponseInternal>;};
type API
type API< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = Middleware<RequestInternal, ResponseInternal> & AdditionalMethods<RequestInternal, ResponseInternal>;
type Callback
type Callback = ( stats?: import('webpack').Stats | import('webpack').MultiStats | undefined) => any;
type Close
type Close = (callback: (err: Error | null | undefined) => void) => any;
type Compiler
type Compiler = import('webpack').Compiler;
type Configuration
type Configuration = import('webpack').Configuration;
type Context
type Context< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = { state: boolean; stats: Stats | MultiStats | undefined; callbacks: Callback[]; options: Options<RequestInternal, ResponseInternal>; compiler: Compiler | MultiCompiler; watching: Watching | MultiWatching | undefined; logger: Logger; outputFileSystem: OutputFileSystem;};
type ExtendedServerResponse
type ExtendedServerResponse = { locals?: | { webpack?: { devMiddleware?: Context<IncomingMessage, ServerResponse>; }; } | undefined;};
type Extra
type Extra = import('./utils/getFilenameFromUrl').Extra;
type FilledContext
type FilledContext< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = WithoutUndefined<Context<RequestInternal, ResponseInternal>, 'watching'>;
type GetFilenameFromUrl
type GetFilenameFromUrl = ( url: string, extra?: Extra | undefined) => string | undefined;
type HapiOptions
type HapiOptions = Options & { compiler: Compiler | MultiCompiler;};
type HapiPlugin
type HapiPlugin<S, O> = HapiPluginBase<S, O> & { pkg: { name: string; }; multiple: boolean;};
type HapiPluginBase
type HapiPluginBase<S, O> = { register: (server: S, options: O) => void | Promise<void>;};
type Headers
type Headers< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = | NormalizedHeaders | (( req: RequestInternal, res: ResponseInternal, context: Context<RequestInternal, ResponseInternal> ) => void | undefined | NormalizedHeaders) | undefined;
type IncomingMessage
type IncomingMessage = import('http').IncomingMessage;
type Invalidate
type Invalidate = (callback: Callback) => any;
type Logger
type Logger = ReturnType<Compiler['getInfrastructureLogger']>;
type Middleware
type Middleware< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = ( req: RequestInternal, res: ResponseInternal, next: NextFunction) => Promise<void>;
type ModifyResponseData
type ModifyResponseData< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = ( req: RequestInternal, res: ResponseInternal, data: Buffer | ReadStream, byteLength: number) => ResponseData;
type MultiCompiler
type MultiCompiler = import('webpack').MultiCompiler;
type MultiStats
type MultiStats = import('webpack').MultiStats;
type MultiWatching
type MultiWatching = ReturnType<MultiCompiler['watch']>;
type NextFunction
type NextFunction = (err?: any) => void;
type NormalizedHeaders
type NormalizedHeaders = | Record<string, string | number> | Array<{ key: string; value: number | string; }>;
type Options
type Options< RequestInternal extends IncomingMessage = import('http').IncomingMessage, ResponseInternal extends ServerResponse = ServerResponse> = { mimeTypes?: | { [key: string]: string; } | undefined; mimeTypeDefault?: string | undefined; writeToDisk?: boolean | ((targetPath: string) => boolean) | undefined; methods?: string[] | undefined; headers?: Headers<RequestInternal, ResponseInternal>; publicPath?: NonNullable<Configuration['output']>['publicPath']; stats?: Configuration['stats']; serverSideRender?: boolean | undefined; outputFileSystem?: OutputFileSystem | undefined; index?: string | boolean | undefined; modifyResponseData?: | ModifyResponseData<RequestInternal, ResponseInternal> | undefined; etag?: 'strong' | 'weak' | undefined; lastModified?: boolean | undefined; cacheControl?: | string | number | boolean | { maxAge?: number; immutable?: boolean; } | undefined; cacheImmutable?: boolean | undefined;};
type OutputFileSystem
type OutputFileSystem = import('webpack').OutputFileSystem & { createReadStream?: typeof import('fs').createReadStream; statSync: import('fs').StatSyncFn; readFileSync: typeof import('fs').readFileSync;};
type ReadStream
type ReadStream = import('fs').ReadStream;
type ResponseData
type ResponseData = { data: Buffer | ReadStream; byteLength: number;};
type Schema
type Schema = import('schema-utils/declarations/validate').Schema;
type ServerResponse
type ServerResponse = import('http').ServerResponse & ExtendedServerResponse;
type Stats
type Stats = import('webpack').Stats;
type WaitUntilValid
type WaitUntilValid = (callback: Callback) => any;
type Watching
type Watching = Compiler['watching'];
type WatchOptions
type WatchOptions = NonNullable<Configuration['watchOptions']>;
type WithOptional
type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
type WithoutUndefined
type WithoutUndefined<T, K extends keyof T> = T & { [P in K]: NonNullable<T[P]>;};
Package Files (1)
Dependencies (6)
Dev Dependencies (43)
- @babel/cli
- @babel/core
- @babel/preset-env
- @commitlint/cli
- @commitlint/config-conventional
- @fastify/express
- @hapi/hapi
- @hono/node-server
- @types/connect
- @types/express
- @types/mime-types
- @types/node
- @types/on-finished
- @webpack-contrib/eslint-config-webpack
- babel-jest
- chokidar
- connect
- cross-env
- cspell
- deepmerge
- del-cli
- eslint
- eslint-config-prettier
- eslint-plugin-import
- execa
- express
- fastify
- file-loader
- finalhandler
- hono
- husky
- jest
- joi
- koa
- lint-staged
- npm-run-all
- prettier
- router
- standard-version
- strip-ansi
- supertest
- typescript
- webpack
Peer Dependencies (1)
Badge
To add a badge like this oneto 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/webpack-dev-middleware
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/webpack-dev-middleware)
- HTML<a href="https://www.jsdocs.io/package/webpack-dev-middleware"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4131 ms. - Missing or incorrect documentation? Open an issue for this package.