mirror of https://github.com/webpack/webpack.git
expose the module to loaders
This commit is contained in:
parent
7e8b2c6972
commit
776eabc6f1
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue