You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
359 B

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