-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathesbench.config.js
More file actions
88 lines (77 loc) · 2.04 KB
/
esbench.config.js
File metadata and controls
88 lines (77 loc) · 2.04 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// noinspection ES6UnusedImports
import {
defineConfig,
htmlReporter,
inProcessExecutor,
NodeExecutor,
PlaywrightExecutor,
ProcessExecutor,
rawReporter,
textReporter,
ViteBuilder,
WebextExecutor,
WebRemoteExecutor,
} from "esbench/host";
import { chromium, firefox, webkit } from "playwright";
const viteBuilder = new ViteBuilder();
const playwrightBrowsers = [
new PlaywrightExecutor(firefox),
new PlaywrightExecutor(webkit),
new PlaywrightExecutor(chromium),
];
const browserExecutor = new WebRemoteExecutor();
export default defineConfig({
reporters: [
textReporter(),
rawReporter(),
htmlReporter(),
],
toolchains: [{
// The micromatch patterns ESBench used to glob suite files.
include: ["./{self,node,profilers}/*.[jt]s"],
}, {
include: ["./es/*.[jt]s"],
/*
* To run suites with `playwrightBrowsers`, uncomment the next line
* or add `--experimental-import-meta-resolve` to Node options.
*/
// builders: [viteBuilder],
executors: [
// Run suites directly in the context, it's also the default value.
inProcessExecutor,
// Run suites on your browser.
// new WebRemoteExecutor({ open: {} }),
// Use playwright's browsers.
// ...playwrightBrowsers,
// Run in Node with TurboFan compiler disabled.
// new NodeExecutor({ execArgv: ["--no-opt"] }),
// More JS runtimes, you need to install them.
// new ProcessExecutor("bun run --bun"),
],
}, {
include: ["./web/*.js"],
builders: [viteBuilder],
executors: [browserExecutor],
}, {
include: ["./webext/*.js"],
builders: [viteBuilder],
executors: [new WebextExecutor(chromium)],
}, {
// Node 22.6.0 drops the support of HTTP import.
include: ["./misc/import-http-module.js"],
executors: [browserExecutor],
}, {
// Build the suite with different config, see their impact on performance.
include: ["./misc/transpile.js"],
builders: [
{
name: "modern",
use: new ViteBuilder({ build: { target: "esnext" } }),
},
{
name: "transpile",
use: new ViteBuilder({ build: { target: "es6" } }),
},
],
}],
});