a zip code crypto-currency system good for red ONLY

UseFilePlugin.js 742B

123456789101112131415161718192021222324
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. function UseFilePlugin(source, filename, target) {
  6. this.source = source;
  7. this.filename = filename;
  8. this.target = target;
  9. }
  10. module.exports = UseFilePlugin;
  11. UseFilePlugin.prototype.apply = function(resolver) {
  12. var filename = this.filename;
  13. var target = this.target;
  14. resolver.plugin(this.source, function(request, callback) {
  15. var filePath = resolver.join(request.path, filename);
  16. var obj = Object.assign({}, request, {
  17. path: filePath,
  18. relativePath: request.relativePath && resolver.join(request.relativePath, filename)
  19. });
  20. resolver.doResolve(target, obj, "using path: " + filePath, callback);
  21. });
  22. };