@wii/fastify-webpack
Version:
fastify plugin for webpack
48 lines (47 loc) • 1.33 kB
TypeScript
import { Compiler, Stats } from 'webpack';
import { IFs } from 'memfs';
declare module 'fastify' {
interface FastifyReply {
webpack: {
outputFileSystem: IFs;
stats?: Stats;
};
}
}
/**
* Compiler watch options
* copied from webpack
*/
export interface WatchOptions {
/**
* Delay the rebuilt after the first change. Value is a time in ms.
*/
aggregateTimeout?: number;
/**
* Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
*/
followSymlinks?: boolean;
/**
* Ignore some files from watching (glob pattern or regexp).
*/
ignored?: string | RegExp | string[];
/**
* Enable polling mode for watching.
*/
poll?: number | boolean;
/**
* Stop watching when stdin stream has ended.
*/
stdin?: boolean;
}
export interface FastifyWebpackOptions {
compiler: Compiler;
outputFileSystem?: IFs;
watchOptions?: WatchOptions;
/**
* @default /__fastify_webpack_hot
*/
path?: string;
}
declare const fastifyWebpack: import("fastify").FastifyPluginAsync<FastifyWebpackOptions, import("fastify").RawServerDefault, import("fastify").FastifyTypeProviderDefault>;
export default fastifyWebpack;