Skip to content

Commit 776eabc

Browse files
committed
expose the module to loaders
1 parent 7e8b2c6 commit 776eabc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/NormalModule.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ NormalModule.prototype.readableIdentifier = function(requestShortener) {
3838

3939
NormalModule.prototype.fillLoaderContext = function fillLoaderContext(loaderContext, options, compilation) {
4040
loaderContext.webpack = true;
41-
compilation.applyPlugins("normal-module-loader", loaderContext, this);
4241
loaderContext.emitFile = function(name, content, sourceMap) {
4342
if(typeof sourceMap === "string") {
4443
this.assets[name] = new OriginalSource(content, sourceMap);
@@ -48,8 +47,10 @@ NormalModule.prototype.fillLoaderContext = function fillLoaderContext(loaderCont
4847
this.assets[name] = new RawSource(content);
4948
}
5049
}.bind(this);
50+
loaderContext._module = this;
5151
loaderContext._compilation = compilation;
5252
loaderContext._compiler = compilation.compiler;
53+
compilation.applyPlugins("normal-module-loader", loaderContext, this);
5354
};
5455

5556
NormalModule.prototype.disconnect = function disconnect() {

0 commit comments

Comments
 (0)