diff --git a/types/webpack-manifest-plugin/index.d.ts b/types/webpack-manifest-plugin/index.d.ts index 0a4cc16b07ffb5..7158c75727bf7e 100644 --- a/types/webpack-manifest-plugin/index.d.ts +++ b/types/webpack-manifest-plugin/index.d.ts @@ -3,12 +3,12 @@ // Definitions by: Andrew Makarov , Jeremy Monson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { Plugin, compilation, Compiler } from 'webpack'; +import { WebpackPluginInstance, compilation, Compiler } from 'webpack'; import { SyncWaterfallHook } from 'tapable'; -export class WebpackManifestPlugin extends Plugin { - constructor(options?: Options); -} +export const WebpackManifestPlugin: { + new (options?: Options): WebpackPluginInstance; +}; export interface FileDescriptor { /** Only available if isChunk is true. */ diff --git a/types/webpack-manifest-plugin/webpack-manifest-plugin-tests.ts b/types/webpack-manifest-plugin/webpack-manifest-plugin-tests.ts index da99b5e7d5de97..bee11eb0e90028 100644 --- a/types/webpack-manifest-plugin/webpack-manifest-plugin-tests.ts +++ b/types/webpack-manifest-plugin/webpack-manifest-plugin-tests.ts @@ -3,32 +3,34 @@ import path = require('path'); import { WebpackManifestPlugin, Options } from 'webpack-manifest-plugin'; const options: Options = { - fileName: 'manifest.json', basePath: '/src/', - seed: { - name: 'Hello world', - }, - publicPath: 'prod', - writeToFileEmit: false, + fileName: 'manifest.json', filter: file => file.isInitial, + generate: (seed, files, entries) => + files.reduce((manifest, { name, path }) => (name ? { ...manifest, [name]: path } : manifest), seed), map: file => { if (file.name) { file.name = path.join(path.dirname(file.path), file.name); } return file; }, - sort: (a, b) => a.path.localeCompare(b.path), - generate: (seed, files) => - files.reduce((manifest, { name, path }) => (name ? { ...manifest, [name]: path } : manifest), seed), + publicPath: 'prod', + removeKeyHash: /[a-Z0-9]/g, + seed: { + name: 'Hello world', + }, serialize: manifest => JSON.stringify(manifest, null, 2), + sort: (a, b) => a.path.localeCompare(b.path), + useEntryKeys: true, + writeToFileEmit: false, }; const c: Configuration = { plugins: [ new WebpackManifestPlugin(), new WebpackManifestPlugin({ - fileName: 'my-manifest.json', basePath: '/app/', + fileName: 'my-manifest.json', seed: { name: 'My Manifest', },