docs/config/benchmark.md
{ include?, exclude?, ... }Options used when running vitest bench.
string[]['**/*.{bench,benchmark}.?(c|m)[jt]s?(x)']Include globs for benchmark test files
string[]['node_modules', 'dist', '.idea', '.git', '.cache']Exclude globs for benchmark test files
string[][]Include globs for in-source benchmark test files. This option is similar to includeSource.
When defined, Vitest will run all matched files with import.meta.vitest inside.
Arrayable<BenchmarkBuiltinReporters | Reporter>'default'Custom reporter for output. Can contain one or more built-in report names, reporter instances, and/or paths to custom reporters.
Deprecated in favor of benchmark.outputJson.
string | undefinedundefinedA file path to store the benchmark result, which can be used for --compare option later.
For example:
# save main branch's result
git checkout main
vitest bench --outputJson main.json
# change a branch and compare against main
git checkout feature
vitest bench --compare main.json
string | undefinedundefinedA file path to a previous benchmark result to compare against current runs.