read-wasm.js 669 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. // Note: This file is replaced with "read-wasm-browser.js" when this module is
  3. // bundled with a packager that takes package.json#browser fields into account.
  4. const fs = require("fs");
  5. const path = require("path");
  6. module.exports = function readWasm() {
  7. return new Promise((resolve, reject) => {
  8. const wasmPath = path.join(__dirname, "mappings.wasm");
  9. fs.readFile(wasmPath, null, (error, data) => {
  10. if (error) {
  11. reject(error);
  12. return;
  13. }
  14. resolve(data.buffer);
  15. });
  16. });
  17. };
  18. module.exports.initialize = _ => {
  19. console.debug(
  20. "SourceMapConsumer.initialize is a no-op when running in node.js"
  21. );
  22. };