Merge pull request #26718 from cleavera/master

[@types/webpack] add loaderModule method to loaderContext
This commit is contained in:
Paul van Brenk
2018-06-27 10:33:58 -07:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -1594,6 +1594,14 @@ declare namespace webpack {
*/
exec(code: string, filename: string): any;
/**
* Resolves the given request to a module, applies all configured loaders and calls
* back with the generated source, the sourceMap and the module instance (usually an
* instance of NormalModule). Use this function if you need to know the source code
* of another module to generate the result.
*/
loadModule(request: string, callback: (err: Error | null, source: string, sourceMap: RawSourceMap, module: Module) => void): any;
/**
* Resolve a request like a require expression.
*/
+1
View File
@@ -516,6 +516,7 @@ function loader(this: webpack.loader.LoaderContext, source: string | Buffer, sou
this.addDependency('');
this.loadModule('path', (err: Error | null, result: string, sourceMap: RawSourceMap, module: webpack.Module) => { });
this.resolve('context', 'request', (err: Error, result: string) => { });
this.emitWarning('warning message');