webpack/lib/ExternalsPlugin.js

17 lines
522 B
JavaScript
Raw Normal View History

2014-03-05 16:58:51 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var ExternalModuleFactoryPlugin = require("./ExternalModuleFactoryPlugin");
2014-03-05 16:58:51 +08:00
function ExternalsPlugin(type, externals) {
this.type = type;
this.externals = externals;
}
module.exports = ExternalsPlugin;
ExternalsPlugin.prototype.apply = function(compiler) {
compiler.plugin("compile", function(params) {
params.normalModuleFactory.apply(new ExternalModuleFactoryPlugin(this.type, this.externals));
2014-03-05 16:58:51 +08:00
}.bind(this));
};