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
Degradation v0.18.0: Terminal no longer reloads on save #1621
Comments
Related PR: #1166 Related comment: |
I can open a PR for a config/cli flag if there's interest. |
It’s better to discuss first, since the change is intentional. |
Whats the best workaround? I'm using vite-node directly. Best workaround I can think of is involves nodemon, but there's gotta be a better way. |
@FossPrime This is the plugin I use vite-plugin-clear-vitest.ts import pc from 'picocolors';
import type { Plugin } from 'vite';
let hasResolved = false;
const clear = () => {
process.stdout.write('\x1B[2J\x1B[3J\x1B[H\x1Bc\n');
};
// Clear terminal on initial and subsequent loads for vitest
const plugin = (): Plugin => ({
name: 'clear-vitest',
config: () => clear(),
resolveId: () => ((hasResolved = true), null),
load: (path) => {
if (hasResolved && /\.test\.(?:t|j)sx?/.test(path)) {
clear();
const pwd = process.env.PWD ? `${process.env.PWD}/` : '';
console.log(pc.black(pc.bgBlue(' RERUN ')), pc.gray(path.replace(pwd, '')), '\n');
}
},
});
export default plugin; vitest.config.ts import { defineConfig } from 'vitest/config';
import clearVitest from './vite-plugin-clear-vitest';
export default defineConfig({
plugins: [
clearVitest(),
],
}); |
The team likes how the terminal behaves at the moment. |
Describe the bug
0.17.1: reloads the terminal on save, this is helpful for developer feedback.
0.18.0: doesn't reload the terminal, shows a blue indicator
The original 0.17.1 version had this right, it's a much better dev experience seeing the full reload. The new version is much harder to discern if the test updated.
In the case that the maintainers decide v0.18.0 is the ideal experience, a fallback proposal would be to allow an option to reload on save.
Reproduction
Repo
v0.17.1
v0.18.0
rerun x2
updatesSystem Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: