mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
updated typings and test file
This commit is contained in:
+8
-13
@@ -20,13 +20,13 @@ declare namespace WebpackManifestPlugin {
|
||||
}
|
||||
|
||||
interface HooksOptions {
|
||||
path?: string;
|
||||
chunk?: Chunk;
|
||||
name?: string;
|
||||
isChunk?: boolean;
|
||||
isInitial?: boolean;
|
||||
isAsset?: boolean;
|
||||
isModuleAsset?: boolean;
|
||||
path: string;
|
||||
chunk: Chunk;
|
||||
name: string | null;
|
||||
isChunk: boolean;
|
||||
isInitial: boolean;
|
||||
isAsset: boolean;
|
||||
isModuleAsset: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
@@ -46,11 +46,6 @@ declare namespace WebpackManifestPlugin {
|
||||
*/
|
||||
publicPath?: string;
|
||||
|
||||
/**
|
||||
* Removes unwanted strings from source filenames.
|
||||
*/
|
||||
stripSrc?: string | RegExp;
|
||||
|
||||
/**
|
||||
* If set to true will emit to build folder and memory in combination with webpack-dev-server
|
||||
* Default: false
|
||||
@@ -79,6 +74,6 @@ declare namespace WebpackManifestPlugin {
|
||||
* Create the manifest. It can return anything as long as it's serialisable by JSON.stringify. Use the seed options to populate manifest.
|
||||
* Default: (manifest, {name, path}) => ({...manifest, [name]: path})
|
||||
*/
|
||||
reduce?: (options: HooksOptions) => void;
|
||||
reduce?: (manifest: any, options: HooksOptions) => void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import * as WebpackManifestPlugin from 'webpack-manifest-plugin';
|
||||
import path = require('path');
|
||||
import WebpackManifestPlugin = require('webpack-manifest-plugin');
|
||||
|
||||
const options: WebpackManifestPlugin.Options = {
|
||||
filename: 'manifest.json',
|
||||
basePath: '/src/',
|
||||
seed: {
|
||||
name: 'Hello world',
|
||||
},
|
||||
publicPath: 'prod',
|
||||
writeToFileEmit: false,
|
||||
filter: (file) => file.isInitial,
|
||||
map: (file) => {
|
||||
if (file.name) {
|
||||
file.name = path.join(path.dirname(file.path), file.name);
|
||||
return file;
|
||||
}
|
||||
},
|
||||
reduce: (manifest, { name, path }) => {
|
||||
if (name) {
|
||||
return { ...manifest, [name]: path };
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const c: Configuration = {
|
||||
plugins: [
|
||||
|
||||
Reference in New Issue
Block a user