mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(webpack-entry-manifest-plugin): new definition (#47816)
- definition file - tests https://github.com/nuintun/webpack-entry-manifest-plugin Thanks!
This commit is contained in:
parent
b8e62f2a8b
commit
fc8039e9b5
44
types/webpack-entry-manifest-plugin/index.d.ts
vendored
Normal file
44
types/webpack-entry-manifest-plugin/index.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
// Type definitions for webpack-entry-manifest-plugin 2.0
|
||||
// Project: https://github.com/nuintun/webpack-entry-manifest-plugin#readme
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
/**
|
||||
* Webpack plugin for generating an asset manifest with grouped entry chunks
|
||||
*/
|
||||
declare class WebpackEntryManifestPlugin extends Plugin {
|
||||
name: 'WebpackEntryManifestPlugin';
|
||||
constructor(options?: WebpackEntryManifestPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace WebpackEntryManifestPlugin {
|
||||
interface Options {
|
||||
/**
|
||||
* Assets manifest filename
|
||||
* @default 'manifest.json'
|
||||
*/
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* Assets path map function
|
||||
* @default path => path
|
||||
*/
|
||||
map?: (path: string, chunk: string) => string;
|
||||
|
||||
/**
|
||||
* Assets path filter function
|
||||
* @default () => true
|
||||
*/
|
||||
filter?: (path: string, chunk: string) => boolean;
|
||||
|
||||
/**
|
||||
* Assets manifest serialize function
|
||||
* @default manifest => JSON.stringify(manifest)
|
||||
*/
|
||||
serialize?: (manifest: any) => string;
|
||||
}
|
||||
}
|
||||
|
||||
export = WebpackEntryManifestPlugin;
|
||||
23
types/webpack-entry-manifest-plugin/tsconfig.json
Normal file
23
types/webpack-entry-manifest-plugin/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpack-entry-manifest-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/webpack-entry-manifest-plugin/tslint.json
Normal file
1
types/webpack-entry-manifest-plugin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -0,0 +1,13 @@
|
||||
import webpack = require('webpack');
|
||||
import WebpackEntryManifestPlugin = require('webpack-entry-manifest-plugin');
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
plugins: [
|
||||
new WebpackEntryManifestPlugin({
|
||||
filename: 'manifest.json',
|
||||
map: (path, chunk) => path,
|
||||
filter: (path, chunk) => true,
|
||||
serialize: manifest => JSON.stringify(manifest),
|
||||
}),
|
||||
],
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user