index.js 723 B

1234567891011121314
  1. // Bunlers add the `process.browser` flag to indicate the build enviroment.
  2. // Throw a verbose error if we see people bundling the Node.js build in their
  3. // browser, since it probably won't work for them (or at least not give them)
  4. // nice tree shaking and such.
  5. //
  6. // Note that we don't check the presence of window/document, since those can
  7. // be emulated in common test scenarios (e.g. jest's default setup with jsdom).
  8. if (process.browser) {
  9. throw new Error('You tried to import the Node.js version of blake3, instead of the browser ' +
  10. 'version, in your build. You can fix this by importing "blake3/browser" ' +
  11. 'instead of "blake3"');
  12. }
  13. export * from './node.js';
  14. //# sourceMappingURL=index.js.map