TryNextPlugin.js 509 B

123456789101112131415161718
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. function TryNextPlugin(source, message, target) {
  6. this.source = source;
  7. this.message = message;
  8. this.target = target;
  9. }
  10. module.exports = TryNextPlugin;
  11. TryNextPlugin.prototype.apply = function(resolver) {
  12. var target = this.target;
  13. var message = this.message;
  14. resolver.plugin(this.source, function(request, callback) {
  15. resolver.doResolve(target, request, message, callback);
  16. });
  17. };