@webpack-contrib/config-loader
Version:
A webpack configuration loader
22 lines (19 loc) • 458 B
JavaScript
module.exports = {
default: (config) => config.plugins,
constructor: (config) => {
const { plugins } = config;
/* istanbul ignore if */
if (!plugins || !plugins.length) {
return plugins;
}
return plugins.reduceRight(
(array, other) =>
array.findIndex(
(plugin) => plugin.constructor.name === other.constructor.name
) < 0
? [...array, other]
: array,
[]
);
},
};