aboutsummaryrefslogtreecommitdiff
path: root/test/bundler/integration/vue/benchmark-bun.ts
blob: 10c9bce911e5cb67eb8db38c22f9dfc1ba1a7a5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import path from "path";
import vue from "esbuild-plugin-vue-next";
import { bench, group, run } from "mitata";
import * as esbuild from "esbuild";

group("esbuild-plugin-vue-next", () => {
  bench("Bun.build", async () => {
    await Bun.build({
      entrypoints: [path.join(import.meta.dir, "/index.js")],
      outdir: path.join(import.meta.dir, "/dist"),
      plugins: [vue({}) as any],
      minify: true,
      splitting: true,
    });
  });
  const __dirname = path.dirname(new URL(import.meta.url).pathname);
  bench("esbuild.build", async () => {
    await esbuild.build({
      entryPoints: [path.join(__dirname, "/index.js")],
      outdir: path.join(__dirname, "/dist"),
      plugins: [vue({})],
      minify: true,
      splitting: true,
      format: "esm",
      bundle: true,
    });
  });
});
await run();