import { fileURLToPath } from 'url';
import { createRequire } from 'module';
const require = createRequire(fileURLToPath(import.meta.url));

/** @type {import('./dist/esm')} */
const esm = require('./dist/esm');
// have to catch any errors raised, or else node prints a profoundly
// unhelpful result, since the custom inspect symbol does not survive
// transfer to the isolate on the main thread.
let globalPreload, resolve, load, getFormat, transformSource;
try {
  ({ globalPreload, resolve, load, getFormat, transformSource } = esm.registerAndCreateEsmHooks());
} catch (er) {
  console.error(er);
  process.exit(1);
}
export { globalPreload, resolve, load, getFormat, transformSource };
