description and source-codefunction CleanWebpackPlugin(paths, options) {
//backwards compatibility
if (typeof options === 'string') {
options = {
root: options
}
}
options = options || {};
if (options.verbose === undefined) {
if (process.env.NODE_ENV === 'test') {
options.verbose = false;
} else {
options.verbose = true;
}
}
options.allowExternal = options.allowExternal || false;
if (options.dry === undefined) {
options.dry = false;
}
// determine webpack root
options.root = options.root || path.dirname(module.parent.filename);
// allows for a single string entry
if (typeof paths == 'string' || paths instanceof String) {
paths = [paths];
}
// store paths and options
this.paths = paths;
this.options = options;
}