async function requireWrapper(requirePath) {
  // For windows.
  if (path.isAbsolute(requirePath)) {
    requirePath = url.pathToFileURL(requirePath).href;
  }

  /** @type {any} */
  let module;
  if (bundledModules.has(requirePath)) {
    module = await bundledModules.get(requirePath);
  } else if (requirePath.match(/\.(js|mjs|cjs)$/)) {
    module = await import(requirePath);
  } else {
    requirePath += '.js';
    module = await import(requirePath);
  }

  if (module.default) return module.default;

  // Find a valid named export.
  const methods = new Set(['meta']);
  const possibleNamedExports = Object.keys(module).filter(key => {
    if (!(module[key] && module[key] instanceof Object)) return false;
    return Object.getOwnPropertyNames(module[key]).some(method => methods.has(method));
  });
  if (possibleNamedExports.length === 1) return possibleNamedExports[0];
  if (possibleNamedExports.length > 1) {
    throw new Error(`module '${requirePath}' has too many possible exports`);
  }

  throw new Error(`module '${requirePath}' missing default export`);
}
Wraps `import`/`require` with an entrypoint for bundled dynamic modules.
See build-bundle.js
@param {string} requirePath