MCPcopy
hub / github.com/webpack/webpack / getCurrentLoader

Method getCurrentLoader

lib/NormalModule.js:1398–1409  ·  view source on GitHub ↗

* @param {AnyLoaderContext} loaderContext loader context * @param {number} index index * @returns {LoaderItem | null} loader

(loaderContext, index = loaderContext.loaderIndex)

Source from the content-addressed store, hash-verified

1396 * @returns {LoaderItem | null} loader
1397 */
1398 getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
1399 if (
1400 this.loaders &&
1401 this.loaders.length &&
1402 index < this.loaders.length &&
1403 index >= 0 &&
1404 this.loaders[index]
1405 ) {
1406 return this.loaders[index];
1407 }
1408 return null;
1409 }
1410
1411 /**
1412 * @param {string} context the compilation context

Callers 3

getCurrentLoaderNameMethod · 0.95
_createLoaderContextMethod · 0.95
processResultMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected