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.

17 lines
410 B

4 years ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. class ModuleDependencyTemplateAsId {
  7. apply(dep, source, runtime) {
  8. if (!dep.range) return;
  9. const content = runtime.moduleId({
  10. module: dep.module,
  11. request: dep.request
  12. });
  13. source.replace(dep.range[0], dep.range[1] - 1, content);
  14. }
  15. }
  16. module.exports = ModuleDependencyTemplateAsId;