mirror of https://github.com/webpack/webpack.git
				
				
				
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			467 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			467 B
		
	
	
	
		
			JavaScript
		
	
	
	
| /*
 | |
| 	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);
 | |
| 			}
 | |
| 		};
 | |
| 	}
 | |
| 
 | |
| 	constructor(plugins) {
 | |
| 		this._plugins = plugins || {};
 | |
| 	}
 | |
| 
 | |
| 	apply(object) {
 | |
| 		for(const name in this._plugins) {
 | |
| 			object.plugin(name, this._plugins[name]);
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| 
 | |
| module.exports = AbstractPlugin;
 |