UNPKG

e-lado

Version:

[![CircleCI](https://circleci.com/gh/sharetribe/sharetribe/tree/master.svg?style=svg)](https://circleci.com/gh/sharetribe/sharetribe/tree/master) [![Dependency Status](https://gemnasium.com/sharetribe/sharetribe.png)](https://gemnasium.com/sharetribe/shar

19 lines (17 loc) 739 B
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var FunctionModuleTemplatePlugin = require("./FunctionModuleTemplatePlugin"); var RequestShortener = require("./RequestShortener"); function FunctionModulePlugin(options, requestShortener) { this.options = options; this.requestShortener = requestShortener; } module.exports = FunctionModulePlugin; FunctionModulePlugin.prototype.apply = function(compiler) { compiler.plugin("compilation", function(compilation) { compilation.moduleTemplate.requestShortener = this.requestShortener || new RequestShortener(compiler.context); compilation.moduleTemplate.apply(new FunctionModuleTemplatePlugin()); }.bind(this)); };