a zip code crypto-currency system good for red ONLY

NodeEnvironmentPlugin.js 948B

1234567891011121314151617181920212223242526
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const NodeWatchFileSystem = require("./NodeWatchFileSystem");
  7. const NodeOutputFileSystem = require("./NodeOutputFileSystem");
  8. const NodeJsInputFileSystem = require("enhanced-resolve/lib/NodeJsInputFileSystem");
  9. const CachedInputFileSystem = require("enhanced-resolve/lib/CachedInputFileSystem");
  10. class NodeEnvironmentPlugin {
  11. apply(compiler) {
  12. compiler.inputFileSystem = new CachedInputFileSystem(new NodeJsInputFileSystem(), 60000);
  13. const inputFileSystem = compiler.inputFileSystem;
  14. compiler.outputFileSystem = new NodeOutputFileSystem();
  15. compiler.watchFileSystem = new NodeWatchFileSystem(compiler.inputFileSystem);
  16. compiler.plugin("before-run", (compiler, callback) => {
  17. if(compiler.inputFileSystem === inputFileSystem)
  18. inputFileSystem.purge();
  19. callback();
  20. });
  21. }
  22. }
  23. module.exports = NodeEnvironmentPlugin;