webpack/lib/FunctionModulePlugin.js

15 lines
585 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
*/
var FunctionModuleTemplate = require("./FunctionModuleTemplate");
var RequestShortener = require("./RequestShortener");
function FunctionModulePlugin(options, requestShortener) {
2013-01-31 01:49:25 +08:00
this.options = options;
this.requestShortener = requestShortener;
2013-01-31 01:49:25 +08:00
}
module.exports = FunctionModulePlugin;
FunctionModulePlugin.prototype.apply = function(compiler) {
compiler.moduleTemplate = new FunctionModuleTemplate(this.options, this.requestShortener || new RequestShortener(compiler.context));
2013-01-31 01:49:25 +08:00
};