mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types/tests for webpack-virtual-modules * Set minimun typescript to match webpack's
29 lines
926 B
TypeScript
29 lines
926 B
TypeScript
// Type definitions for webpack-virtual-modules 0.1
|
|
// Project: https://github.com/sysgears/webpack-virtual-modules
|
|
// Definitions by: Avi Vahl <https://github.com/AviVahl>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
import webpack = require('webpack');
|
|
|
|
/**
|
|
* Plugin that allows dynamic generation of in-memory virtual modules for JavaScript builds
|
|
* created with webpack.
|
|
*/
|
|
declare class VirtualModulesPlugin {
|
|
constructor(modules?: Record<string, string>);
|
|
|
|
/**
|
|
* Attaches necessary hooks, in particular, `afterEnvironment`, `afterResolvers`, and `watchRun` hooks,
|
|
* to ensure that the virtual files are added dynamically.
|
|
*/
|
|
apply(compiler: webpack.Compiler): void;
|
|
|
|
/**
|
|
* Writes a static or dynamic virtual module to a path.
|
|
*/
|
|
writeModule(filePath: string, fileContents: string): void;
|
|
}
|
|
|
|
export = VirtualModulesPlugin;
|