getCurrentRequest.js 337B

1234567891011121314
  1. "use strict";
  2. function getCurrentRequest(loaderContext) {
  3. if(loaderContext.currentRequest)
  4. return loaderContext.currentRequest;
  5. const request = loaderContext.loaders
  6. .slice(loaderContext.loaderIndex)
  7. .map(obj => obj.request)
  8. .concat([loaderContext.resource]);
  9. return request.join("!");
  10. }
  11. module.exports = getCurrentRequest;