diff --git a/config/web/webpack.config.js b/config/web/webpack.config.js index 7079ffb..331c277 100644 --- a/config/web/webpack.config.js +++ b/config/web/webpack.config.js @@ -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 diff --git a/src/createConfig.ts b/src/createConfig.ts index cef803e..016e15a 100644 --- a/src/createConfig.ts +++ b/src/createConfig.ts @@ -9,6 +9,8 @@ type SplitChunks = Required['splitChunks']; type CacheGroups = Exclude["cacheGroups"]; type ExternalsType = Required['externals']; type ExternalsObjectType = Exclude>; +type PluginType = Required['plugins']; +type PluginInstanceType = PluginType extends Array ? Exclude : never /** * 编译环境配置 @@ -24,6 +26,7 @@ export type CompilerConfiguration = { cacheGroups: CacheGroups; }, externals?: ExternalsObjectType; + plugins?: PluginInstanceType[]; }, };