async _esbuildSource(input, plugins) {
    const result = await esbuild.build({
      entryPoints: [input],
      write: false,
      outdir: fs.mkdtempSync(path.join(os.tmpdir(), 'gh-pages-app-')),
      format: 'esm',
      bundle: true,
      splitting: true,
      minify: !process.env.DEBUG,
      plugins,
    });

    // Return the code from the main chunk, and save the rest to the src directory.
    for (let i = 1; i < result.outputFiles.length; i++) {
      const code = result.outputFiles[i].text;
      const basename = path.basename(result.outputFiles[i].path);
      safeWriteFile(`${this.distDir}/src/${basename}`, code);
    }

    this.preloadScripts.push(...result.outputFiles.slice(1).map(f => path.basename(f.path)));
    return result.outputFiles[0].text;
  }
@param {string} input
@param {esbuild.Plugin[]=} plugins
@return {Promise<string>}