node-module-stub.ts 481 B

123456789101112
  1. /**
  2. * Browser stand-in for `node:module`. `createRequire` is unreachable in the
  3. * configured loader path and fails loud if that assumption changes.
  4. */
  5. /** Throwing stand-in for node:module's createRequire (never reached in the browser boot). */
  6. export const createRequire = (): never => {
  7. throw new Error('node:module is not available in the browser')
  8. }
  9. /** Erased type peer for the vendored loader's type-only LoadHookContext import. */
  10. export type LoadHookContext = never