scripts/build/bundler.mjs/runBuild
async function runBuild(bundle, esbuildOptions, buildOptions) {
  if (!buildOptions.babel || bundle.skipBabel) {
    await esbuild.build(esbuildOptions);
    return;
  }

  const { format, plugins, outfile } = esbuildOptions;

  await esbuild.build({
    ...esbuildOptions,
    plugins: plugins.filter(({ name }) => name !== "umd"),
    format: format === "umd" ? "cjs" : format,
    minify: false,
    target: undefined,
  });

  const text = await fs.readFile(outfile);

  const { code } = await babel.transformAsync(text, {
    filename: outfile,
    ...getBabelConfig(bundle),
  });
  await fs.writeFile(outfile, code);

  await esbuild.build({
    ...esbuildOptions,
    define: {},
    plugins: plugins.filter(
      ({ name }) => name === "umd" || name === "throw-warnings"
    ),
    entryPoints: [outfile],
    allowOverwrite: true,
  });
}