···479479If module runner is disabled, Vitest uses a native [Node.js module loader](https://nodejs.org/api/module.html#customization-hooks) to transform files to support `import.meta.vitest`, `vi.mock` and `vi.hoisted`.
480480481481If you don't use these features, you can disable this to improve performance.
482482+483483+## experimental.preParse <Version type="experimental">4.1.3</Version> {#experimental-preparse}
484484+485485+- **Type:** `boolean`
486486+- **Default:** `false`
487487+488488+Parses test specifications before running them. This applies the [`.only`](/api/test#test-only) modifier, the [`-t`](/config/testnamepattern) test name pattern, [`--tags-filter`](/guide/test-tags#syntax), [test lines](/api/advanced/test-specification#testlines), and [test IDs](/api/advanced/test-specification#testids) across all files without executing them. For example, if only a single test is marked with `.only`, Vitest will skip all other tests in all files.
489489+490490+::: tip
491491+This option is recommended when using [`.only`](/api/test#test-only), the [`-t`](/config/testnamepattern) flag, or [`--tags-filter`](/guide/test-tags#syntax).
492492+493493+Enabling it unconditionally may slow down your test runs due to the additional parsing step.
494494+:::
495495+496496+::: warning
497497+Pre-parsing uses static analysis (AST parsing) instead of executing your test files. This means that test names, tags, and modifiers (`.only`, `.skip`, `.todo`) must be statically analyzable. Dynamic test names (e.g., names stored in variables or returned from function calls) and non-literal tags will not be resolved correctly.
498498+499499+```ts
500500+// ✅ works — static string literal
501501+test('adds numbers', () => {})
502502+503503+// ✅ works — static tags
504504+test('my test', { tags: ['unit'] }, () => {})
505505+506506+// ❌ won't match correctly — dynamic name
507507+const name = getName()
508508+test(name, () => {})
509509+510510+// ❌ won't match correctly — dynamic tags
511511+const tags = getTags()
512512+test('my test', { tags }, () => {})
513513+```
514514+:::
+7
docs/guide/cli-generated.md
···963963- **Config:** [experimental.vcsProvider](/config/experimental#experimental-vcsprovider)
964964965965Custom provider for detecting changed files. (default: `git`)
966966+967967+### experimental.preParse
968968+969969+- **CLI:** `--experimental.preParse`
970970+- **Config:** [experimental.preParse](/config/experimental#experimental-preparse)
971971+972972+Parse test specifications before running them. This will apply `.only` flag and test name pattern across all files without running them. (default: `false`)
···920920 description: 'Custom provider for detecting changed files. (default: `git`)',
921921 subcommands: null,
922922 },
923923+ preParse: {
924924+ description: 'Parse test specifications before running them. This will apply `.only` flag and test name pattern across all files without running them. (default: `false`)',
925925+ },
923926 },
924927 },
925928 // disable CLI options
+6
packages/vitest/src/node/types/config.ts
···947947 * implementation of the `VCSProvider` interface to use a different version control system.
948948 */
949949 vcsProvider?: VCSProvider | string
950950+951951+ /**
952952+ * Parse test specifications before running them.
953953+ * This will apply `.only` flag and test name pattern across all files without running them.
954954+ */
955955+ preParse?: boolean
950956 }
951957952958 /**