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.

UnsupportedDependency.js 630B

123456789101112131415161718192021222324252627
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const NullDependency = require("./NullDependency");
  7. const webpackMissingModule = require("./WebpackMissingModule").module;
  8. class UnsupportedDependency extends NullDependency {
  9. constructor(request, range) {
  10. super();
  11. this.request = request;
  12. this.range = range;
  13. }
  14. }
  15. UnsupportedDependency.Template = class UnsupportedDependencyTemplate {
  16. apply(dep, source, runtime) {
  17. source.replace(
  18. dep.range[0],
  19. dep.range[1],
  20. webpackMissingModule(dep.request)
  21. );
  22. }
  23. };
  24. module.exports = UnsupportedDependency;