config中添加插件类型支持
This commit is contained in:
parent
6e211b447c
commit
dd03257367
|
|
@ -1042,7 +1042,8 @@ module.exports = function (webpackEnv) {
|
|||
color: "#85d", // 默认green,进度条颜色支持HEX
|
||||
basic: false, // 默认true,启用一个简单的日志报告器
|
||||
profile:false, // 默认false,启用探查器。
|
||||
})
|
||||
}),
|
||||
...(projectConfiguration && projectConfiguration.plugins ? projectConfiguration.plugins : []),
|
||||
].filter(Boolean),
|
||||
// Turn off performance processing because we utilize
|
||||
// our own hints via the FileSizeReporter
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ type SplitChunks = Required<OptimizationType>['splitChunks'];
|
|||
type CacheGroups = Exclude<SplitChunks, false>["cacheGroups"];
|
||||
type ExternalsType = Required<WebpackConfiguration>['externals'];
|
||||
type ExternalsObjectType = Exclude<ExternalsType, RegExp | string | Function | Array<any>>;
|
||||
type PluginType = Required<WebpackConfiguration>['plugins'];
|
||||
type PluginInstanceType = PluginType extends Array<infer T> ? Exclude<T, false| number | string | Function | null | undefined> : never
|
||||
|
||||
/**
|
||||
* 编译环境配置
|
||||
|
|
@ -24,6 +26,7 @@ export type CompilerConfiguration = {
|
|||
cacheGroups: CacheGroups;
|
||||
},
|
||||
externals?: ExternalsObjectType;
|
||||
plugins?: PluginInstanceType[];
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue