Sha256: f06063b8dbce5254996d46415d2c908b3596cd1c8f814de4ae559b4cffd45108

Contents?: true

Size: 1.35 KB

Versions: 62

Compression:

Stored size: 1.35 KB

Contents

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var ModuleDependency = require("./ModuleDependency");

function LabeledModuleDependency(request, range) {
	ModuleDependency.call(this, request);
	this.Class = LabeledModuleDependency;
	this.range = range;
}
module.exports = LabeledModuleDependency;

LabeledModuleDependency.prototype = Object.create(ModuleDependency.prototype);
LabeledModuleDependency.prototype.type = "labeled require";

LabeledModuleDependency.Template = function LabeledModuleDependencyTemplate() {};

LabeledModuleDependency.Template.prototype.apply = function(dep, source, outputOptions, requestShortener) {
	var comment = "";
	if(outputOptions.pathinfo) comment = "/*! " + requestShortener.shorten(dep.request) + " */ ";
	if(dep.module && dep.module.meta && dep.module.meta.exports) {
		var content = "var __WEBPACK_LABELED_MODULE__" + dep.module.id + " = __webpack_require__(" + comment + dep.module.id + ")";
		dep.module.meta.exports.forEach(function(e) {
			content += ", " + e + " = __WEBPACK_LABELED_MODULE__" + dep.module.id + "." + e;
		});
		content += ";"
	} else if(dep.module) {
		var content = require("./WebpackMissingModule").moduleMetaInfo(dep.request);
	} else {
		var content = require("./WebpackMissingModule").module(dep.request);
	}
	source.replace(dep.range[0], dep.range[1]-1, content);
};

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
smock-0.1.268 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.267 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.266 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.265 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.264 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.263 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.262 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.261 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.260 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.259 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.258 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.256 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.255 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.254 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.253 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.252 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.251 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.250 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.249 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.247 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js