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

#4980 caused a regression in vite-plugin-vue tests #5084

Closed
6 tasks done
haoqunjiang opened this issue Jan 31, 2024 · 2 comments
Closed
6 tasks done

#4980 caused a regression in vite-plugin-vue tests #5084

haoqunjiang opened this issue Jan 31, 2024 · 2 comments

Comments

@haoqunjiang
Copy link
Contributor

Describe the bug

#4980 somehow broke this test case in vite-plugin-vue.
The test case tests the production bundling of a vue file by setting process.env.NODE_ENV to production in vitest globalSetup https://github.com/vitejs/vite-plugin-vue/blob/2c68a7c901a9ef70b46f8befa3599ed86a453982/playground/vitestGlobalSetup.ts#L12-L14
Somehow, it's no longer respected after #4980

Reproduction

vitejs/vite-plugin-vue#332

git clone https://github.com/vitejs/vite-plugin-vue.git
cd vite-plugin-vue
git switch renovate/all-minor-patch
pnpm i
pnpm build
pnpm test-build

System Info

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 224.03 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/Library/Caches/fnm_multishells/36806_1706432535433/bin/node
    Yarn: 1.22.21 - ~/Library/Caches/fnm_multishells/36806_1706432535433/bin/yarn
    npm: 10.2.3 - ~/Library/Caches/fnm_multishells/36806_1706432535433/bin/npm
    pnpm: 8.15.1 - ~/Library/Caches/fnm_multishells/36806_1706432535433/bin/pnpm
    bun: 1.0.3 - ~/.bun/bin/bun
  Browsers:
    Chrome: 120.0.6099.234
    Chrome Canary: 123.0.6269.0
    Safari: 17.3
  npmPackages:
    @vitejs/release-scripts: ^1.3.1 => 1.3.1
    vite: ^5.0.10 => 5.0.10
    vitest: ^1.2.2 => 1.2.2

Used Package Manager

pnpm

Validations

@sheremet-va
Copy link
Member

Global setup is called after the server is created, so isProduction is already set. Did you try setting it in the config file for example? I am not sure how it worked before since we never actually used dev/prod conditions before.

haoqunjiang added a commit to vitejs/vite-plugin-vue that referenced this issue Feb 1, 2024
@haoqunjiang
Copy link
Contributor Author

Thanks! Moving the assignment to the config file worked.

@haoqunjiang haoqunjiang closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants