webpack/lib/AbstractPlugin.js

28 lines
467 B
JavaScript
Raw Normal View History

2013-01-31 01:49:25 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class AbstractPlugin {
static create(plugins) {
return class Plugin extends AbstractPlugin {
constructor() {
super(plugins);
}
};
}
2013-01-31 01:49:25 +08:00
constructor(plugins) {
this._plugins = plugins || {};
2013-01-31 01:49:25 +08:00
}
apply(object) {
for(const name in this._plugins) {
object.plugin(name, this._plugins[name]);
}
2013-01-31 01:49:25 +08:00
}
}
module.exports = AbstractPlugin;