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.

14 lines
496 B

4 years ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. module.exports = function getImportPrefix(loaderContext, query) {
  6. if(query.importLoaders === false)
  7. return "";
  8. var importLoaders = parseInt(query.importLoaders, 10) || 0;
  9. var loadersRequest = loaderContext.loaders.slice(
  10. loaderContext.loaderIndex,
  11. loaderContext.loaderIndex + 1 + importLoaders
  12. ).map(function(x) { return x.request; }).join("!");
  13. return "-!" + loadersRequest + "!";
  14. };