mirror of https://github.com/webpack/webpack.git
17 lines
677 B
JavaScript
17 lines
677 B
JavaScript
|
/*
|
||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||
|
Author Tobias Koppers @sokra
|
||
|
*/
|
||
|
function ModuleDependencyTemplateAsId() {}
|
||
|
module.exports = ModuleDependencyTemplateAsId;
|
||
|
|
||
|
ModuleDependencyTemplateAsId.prototype.apply = function(dep, source, outputOptions, requestShortener) {
|
||
|
var comment = "";
|
||
|
if(outputOptions.pathinfo) comment = "/*! " + requestShortener.shorten(dep.request) + " */ ";
|
||
|
if(dep.module)
|
||
|
var content = comment + dep.module.id;
|
||
|
else
|
||
|
var content = "(function webpackMissingModule() { throw new Error(" + JSON.stringify("Cannot find module \"" + dep.request + "\"") + "); }())";
|
||
|
source.replace(dep.range[0], dep.range[1]-1, content);
|
||
|
};
|