scripts/vendors/bundle-vendors.mjs/bundle
async function bundle(vendor, options) {
  const outfile = getVendorFilePath(vendor);

  /** @type {import("esbuild").CommonOptions} */
  const esbuildOption = {
    entryPoints: [require.resolve(vendor)],
    bundle: true,
    target: ["node12.17.0"],
    platform: "node",
    plugins: [
      esbuildPluginTsNocheck(),
      esbuildPluginLicense({
        cwd: PROJECT_ROOT,
        thirdParty: {
          includePrivate: true,
          output: options.onLicenseFound,
        },
      }),
    ],
    outfile,
  };
  await esbuild.build(esbuildOption);

  // Still running esbuild, because we want collect license
  const module = await import(vendor);
  if (isJson(module)) {
    await fs.rm(outfile);
    const file = getVendorFilePath(vendor, "json");
    await writeJson(file, module);
    saveVendorEntry(vendor, file);
    return;
  }

  await generateDts({ vendor, module });
  saveVendorEntry(vendor, outfile);
}