UNPKG

@webpack-contrib/config-loader

Version:
22 lines (19 loc) 458 B
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, [] ); }, };