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.228 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.227 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.226 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.225 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.224 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.9 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.223 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.222 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.221 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.220 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.219 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.218 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.217 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.216 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.215 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.214 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.213 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.212 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.211 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js
smock-0.1.210 node_modules/webpack/lib/dependencies/LabeledModuleDependency.js