expose the module to loaders

This commit is contained in:
Tobias Koppers 2013-12-19 22:31:12 +01:00
parent 7e8b2c6972
commit 776eabc6f1
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,6 @@ NormalModule.prototype.readableIdentifier = function(requestShortener) {
NormalModule.prototype.fillLoaderContext = function fillLoaderContext(loaderContext, options, compilation) {
loaderContext.webpack = true;
compilation.applyPlugins("normal-module-loader", loaderContext, this);
loaderContext.emitFile = function(name, content, sourceMap) {
if(typeof sourceMap === "string") {
this.assets[name] = new OriginalSource(content, sourceMap);
@ -48,8 +47,10 @@ NormalModule.prototype.fillLoaderContext = function fillLoaderContext(loaderCont
this.assets[name] = new RawSource(content);
}
}.bind(this);
loaderContext._module = this;
loaderContext._compilation = compilation;
loaderContext._compiler = compilation.compiler;
compilation.applyPlugins("normal-module-loader", loaderContext, this);
};
NormalModule.prototype.disconnect = function disconnect() {