Search code examples
viterollupjs

Can Vite continue to watch through syntax errors?


I am running vite build --watch --mode=development. Anytime I save a file with a syntax error, the watcher bails with Command failed with exit code 1. When I had used Webpack previously, the watcher would keep watching and await the syntax fix. This is causing a number of issues. I found a similar issue for vitest that had been resolved, so I am thinking I must be missing some obvious way around this.

I realized this is due to @rollup/plugin-typescript. So my question is related to Vite since Vite relies upon rollup to watch


Solution

  • The answer lies within https://github.com/rollup/plugins/issues/258:

    typescript({ noEmitOnError: false })