Navigation Menu

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

fix: plugins don't think it's watch mode #1784

Merged
merged 1 commit into from Aug 5, 2022

Conversation

sheremet-va
Copy link
Member

Fixes #1003

@wight554
Copy link

wight554 commented Aug 4, 2022

Is it possible to add some custom meta flag e.g. vitestWatch that'll rely on options.watch so plugins can rely on it for adding watch specific logic?
Would it work for non-pre plugins when added here?

@sheremet-va
Copy link
Member Author

sheremet-va commented Aug 4, 2022

Is it possible to add some custom meta flag e.g. vitestWatch that'll rely on options.watch so plugins can rely on it for adding watch specific logic?

Would it work for non-pre plugins when added here?

Options are resolved after configResolve, so no it's not possible, and I am tired of answering the same question to you. 🙁

If for some reason plugin wants to do something vitest-specific, it should use VITEST env variable.

@wight554
Copy link

wight554 commented Aug 4, 2022

Is it possible to add some custom meta flag e.g. vitestWatch that'll rely on options.watch so plugins can rely on it for adding watch specific logic?
Would it work for non-pre plugins when added here?

Options are resolved after configResolve, so no it's not possible, and I am tired of answering the same question to you. 🙁

If for some reason plugin wants to do something vitest-specific, it should use VITEST env variable.

Not talking bout vitest specific, but vitest watch specific, but if api design doesn't allow to expose it in any way, then it might be better to kill watch mode at all
Tbh I'd check for possible performance regressions if esbuild vite logic relies on watch mode before merging it
In my own testing I haven't noticed issues when comparing w/ and w/o watchMode with rollup plugin typescript as transformer

@wight554
Copy link

wight554 commented Aug 4, 2022

Nvm just realized vitest has own watcher instead of relying on vite/transformer, then I see no reason not to merge this one

@sheremet-va sheremet-va merged commit 135b6d8 into vitest-dev:main Aug 5, 2022
@sheremet-va sheremet-va deleted the fix/show-watch-false branch August 5, 2022 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vitest doesn't work well with custom compiler
2 participants