Sha256: e439f46fcc0f828e9ef0381a05be56ff15d430e191c0644090bb5df916d70e08
Contents?: true
Size: 935 Bytes
Versions: 62
Compression:
Stored size: 935 Bytes
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var ConcatSource = require("webpack-core/lib/ConcatSource"); var Template = require("./Template"); function JsonpChunkTemplatePlugin() { } module.exports = JsonpChunkTemplatePlugin; JsonpChunkTemplatePlugin.prototype.apply = function(chunkTemplate) { chunkTemplate.plugin("render", function(modules, chunk) { var jsonpFunction = this.outputOptions.jsonpFunction || Template.toIdentifier("webpackJsonp" + (this.outputOptions.library || "")); var source = new ConcatSource(); source.add(jsonpFunction + "(" + JSON.stringify(chunk.ids) + ","); source.add(modules); source.add(");"); return source; }); chunkTemplate.plugin("hash", function(hash) { hash.update("JsonpChunkTemplatePlugin"); hash.update("3"); hash.update(this.outputOptions.jsonpFunction + ""); hash.update(this.outputOptions.library + ""); }); };
Version data entries
62 entries across 62 versions & 1 rubygems