vitest-dev / vitest-dev/vitest

tsconfigRaw using rolldown vitest

Open
#10,176 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

upstream
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Describe the bug

I want to use a different tsconfig.json depending on the context. But since 4.1, vitest uses rolldown or esbuild.

plugins: [tsconfigPaths({
  projects: [isProd ? './tsconfig.prod.json' : './tsconfig.json'],
})],
esbuild: {
  tsconfigRaw: isProd ? JSON.stringify(tsconfigProd) : JSON.stringify(tsconfigDev),
},

Until now I was using this technique to inject the contents of the file and enable the resolution of the paths, but now tsconfigRaw is no longer available.

Reproduction

esbuild no longer contains the key tsconfigRaw.

System Info
System:
    OS: macOS 26.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 109.69 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.15.0 - /Users/rubnogueira/.local/share/mise/installs/node/24/bin/node
    Yarn: 4.14.1 - /Users/rubnogueira/.local/share/mise/installs/yarn/4.14.1/bin/yarn
    npm: 11.12.1 - /Users/rubnogueira/.local/share/mise/installs/node/24/bin/npm
    pnpm: 10.33.1 - /Users/rubnogueira/.local/share/mise/installs/pnpm/10.33.1/pnpm
    bun: 1.3.13 - /Users/rubnogueira/.local/share/mise/installs/bun/latest/bin/bun
  npmPackages:
    @vitest/coverage-v8: ^4.0.18 => 4.1.4
    vitest: ^4.0.18 => 4.1.4
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported configuration with Vitest 4.1.4, comparing the esbuild and rolldown paths and checking where tsconfigRaw is handled. Trace the relevant Vitest configuration entry point and verify that the selected tsconfig can be passed through while preserving path resolution; done means the supplied production and development configurations work again.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.