UNPKG

generate-examples-index-webpack-plugin

Version:
24 lines (20 loc) 689 B
/** * Given an original configuration (can be undefined) and a list of files, return the webpack configuration * to use to exclude those files from the build stats information * * @param {*} original Original excludeAssets webpack configuration * @param {string[]} files List of files to exclude */ function getExcludeAssets(original, files) { const filter = (assetName) => files.indexOf(assetName) === -1; let excludeAssets; if (!original) { excludeAssets = filter; } else if (Array.isArray(original)) { excludeAssets = original.concat([filter]); } else { excludeAssets = [original, filter]; } return excludeAssets; } module.exports = getExcludeAssets;