Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace read project vite.config.ts files but not apply config to that project #4050

Closed
6 tasks done
cncolder opened this issue Aug 30, 2023 · 2 comments · Fixed by #4096
Closed
6 tasks done

Workspace read project vite.config.ts files but not apply config to that project #4050

cncolder opened this issue Aug 30, 2023 · 2 comments · Fixed by #4096

Comments

@cncolder
Copy link

Describe the bug

Vitest has read the vite.config.ts file under each projects. However, these configuration files did not take effect.

Reproduction

Repo: https://github.com/cncolder/vitest-workspace-demo/tree/main

There are two projects a and b under workspace. Vite define __DEV__ constant. If you run vitest in each projects. The test cases will passed.

If you run vitest in the root of workspace. You will find the vite.config.ts is loaded. But not used for replace the __DEV__ constant.

System Info

System:
    OS: macOS 13.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 346.25 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.asdf/installs/nodejs/lts/bin/node
    Yarn: 1.22.19 - ~/.asdf/installs/nodejs/lts/bin/yarn
    npm: 9.6.7 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 7.18.1 - ~/.asdf/installs/nodejs/lts/bin/pnpm
  Browsers:
    Chrome: 116.0.5845.110
    Edge: 116.0.1938.62
    Safari: 16.6
    Safari Technology Preview: 17.0
  npmPackages:
    vite: ^4.4.9 => 4.4.9 
    vitest: ^0.34.3 => 0.34.3

Used Package Manager

npm

Validations

@johnnybenson
Copy link

Good timing! I just created a reproduction of this too.

https://github.com/johnnybenson/vite-workspace-define-bug

@sheremet-va
Copy link
Member

Looks like it just doesn't pick up defines 🤔 Everything else is respected.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants