mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 04:24:30 +08:00
Merge pull request #14593 from tommytroylin/patch-1
[webpack] Update BannerPlugin definition
This commit is contained in:
17
webpack/index.d.ts
vendored
17
webpack/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for webpack 2.2
|
||||
// Project: https://github.com/webpack/webpack
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>, Tommy Troy Lin <https://github.com/tommytroylin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -661,7 +661,20 @@ declare namespace webpack {
|
||||
*/
|
||||
|
||||
class BannerPlugin extends Plugin {
|
||||
constructor(banner: any, options: any);
|
||||
constructor(options: string | BannerPlugin.Options);
|
||||
}
|
||||
|
||||
namespace BannerPlugin {
|
||||
type Filter = string | RegExp;
|
||||
|
||||
interface Options {
|
||||
banner: string;
|
||||
entryOnly?: boolean;
|
||||
exclude?: Filter | Filter[];
|
||||
include?: Filter | Filter[];
|
||||
raw?: boolean;
|
||||
test?: Filter | Filter[];
|
||||
}
|
||||
}
|
||||
|
||||
class ContextReplacementPlugin extends Plugin {
|
||||
|
||||
@@ -257,7 +257,18 @@ plugin = new webpack.IgnorePlugin(requestRegExp, contextRegExp);
|
||||
|
||||
plugin = new webpack.PrefetchPlugin(context, request);
|
||||
plugin = new webpack.PrefetchPlugin(request);
|
||||
plugin = new webpack.BannerPlugin(banner, options);
|
||||
plugin = new webpack.BannerPlugin('banner');
|
||||
plugin = new webpack.BannerPlugin({
|
||||
banner: 'banner'
|
||||
});
|
||||
plugin = new webpack.BannerPlugin({
|
||||
banner: 'banner',
|
||||
entryOnly: true,
|
||||
exclude: /index/,
|
||||
include: 'test',
|
||||
raw: false,
|
||||
test: ['test', /index/]
|
||||
});
|
||||
plugin = new webpack.optimize.DedupePlugin();
|
||||
plugin = new webpack.optimize.LimitChunkCountPlugin(options);
|
||||
plugin = new webpack.optimize.MinChunkSizePlugin(options);
|
||||
|
||||
Reference in New Issue
Block a user