webpack-genius
Version:
**For chinese developers:** you'd better add taobao mirror before everything start. Or you may fail to install. ```bash yarn config set registry http://registry.npm.taobao.org ```
31 lines (30 loc) • 956 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Copy = void 0;
var tslib_1 = require("tslib");
var PluginHandle_1 = require("./PluginHandle");
var copy_webpack_plugin_1 = tslib_1.__importDefault(require("copy-webpack-plugin"));
var Copy = /** @class */ (function (_super) {
tslib_1.__extends(Copy, _super);
function Copy() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.patterns = [];
return _this;
}
Copy.prototype.copy = function (pattern) {
this.patterns.push(pattern);
return this;
};
Copy.prototype.collect = function () {
if (this.patterns.length) {
return [
new copy_webpack_plugin_1.default({
patterns: this.patterns,
}),
];
}
return [];
};
return Copy;
}(PluginHandle_1.PluginHandle));
exports.Copy = Copy;