Installation
npm install --save @types/webpack-plugin-serve
Summary
This package contains type definitions for webpack-plugin-serve (https://github.com/shellscape/webpack-plugin-serve).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-plugin-serve.
index.d.ts
/// <reference types="node" />
import { Options as HistoryApiFallbackOptions } from "connect-history-api-fallback";
import type { GlobbyOptions } from "globby";
import { Options as HttpProxyMiddlewareConfig, RequestHandler as Proxy } from "http-proxy-middleware";
import { SecureServerOptions as Http2SecureServerOptions, ServerOptions as Http2ServerOptions } from "http2";
import { ServerOptions as HttpsServerOptions } from "https";
import * as Koa from "koa";
import { CompressOptions } from "koa-compress";
import { Options as KoaStaticOptions } from "koa-static";
export interface Builtins {
proxy: (args: HttpProxyMiddlewareConfig) => Proxy;
compress: (opts: CompressOptions) => void;
static: (paths: string[], opts?: KoaStaticOptions) => void;
historyFallback: (opts: HistoryApiFallbackOptions) => void;
websocket: () => void;
four0four: (fn?: (ctx: Koa.Context) => void) => void;
}
export interface StaticObject {
glob?: string | string[] | undefined;
options?: GlobbyOptions | undefined;
}
export interface WebpackPluginServeOptions {
client?: {
address?: string | undefined;
protocol?: "ws" | "wss" | undefined;
retry?: boolean | undefined;
silent?: boolean | undefined;
} | undefined;
compress?: boolean | undefined;
historyFallback?: boolean | HistoryApiFallbackOptions | undefined;
hmr?: boolean | "refresh-on-failure" | undefined;
host?: string | Promise<string> | undefined;
http2?: boolean | Http2ServerOptions | Http2SecureServerOptions | undefined;
https?: HttpsServerOptions | undefined;
liveReload?: boolean | undefined;
log?: {
level: "trace" | "debug" | "info" | "warn" | "error";
timestamp?: boolean | undefined;
} | undefined;
middleware?: ((app: Koa, builtins: Builtins) => void) | undefined;
open?:
| boolean
| {
wait?: boolean | undefined;
app?: string | readonly string[] | undefined;
}
| undefined;
port?: number | Promise<number> | undefined;
progress?: boolean | "minimal" | undefined;
static?: string | string[] | StaticObject | undefined;
status?: boolean | undefined;
waitForBuild?: boolean | undefined;
}
export class WebpackPluginServe<Compiler> {
constructor(opts?: WebpackPluginServeOptions);
attach(): {
apply(compiler: Compiler): void;
};
hook(compiler: Compiler): void;
apply(compiler: Compiler): void;
}
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: @types/connect-history-api-fallback, @types/express, @types/koa, @types/koa-compress, @types/koa-static, @types/node, globby, http-proxy-middleware
Credits
These definitions were written by .