You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following patch seems to help with the issue. Even if I just remove process.exit, though, the build process does seem to exit, just not necessarily with the same exit code as the child process. I also have no idea if this is actually a reliable way to detect watch mode.
diff --git a/packages/vite-plugin-checker/src/main.ts b/packages/vite-plugin-checker/src/main.ts
index 8e70a76..9cc5327 100644
--- a/packages/vite-plugin-checker/src/main.ts+++ b/packages/vite-plugin-checker/src/main.ts@@ -144,7 +144,7 @@ export default function Plugin(userConfig: UserPluginConfig): Plugin {
]
}
},
- buildStart: () => {+ buildStart: function() {
// for build mode
// run a bin command in a separated process
if (viteMode !== 'build') return
@@ -164,7 +164,9 @@ export default function Plugin(userConfig: UserPluginConfig): Plugin {
checkers.map((checker) => spawnChecker(checker, userConfig, localEnv))
)
const exitCode = exitCodes.find((code) => code !== 0) ?? 0
- if (exitCode !== 0) process.exit(exitCode)+ if (exitCode !== 0 && this.getWatchFiles().length === 0) {+ process.exit(exitCode)+ }
})()
},
configureServer(server) {
Describe the bug
When working in watch mode, if the plugin encounters a TypeScript error, it terminates the build process immediately.
Reproduction
In any existing Vite + TypeScript project that is configured to use
vite-plugin-checker
:vite build --watch
.tsc
would report an error.Expected behavior
While in watch mode, it'd be helpful for the build process to continue running even after encountering an error.
System Info
Additional context
The following patch seems to help with the issue. Even if I just remove
process.exit
, though, the build process does seem to exit, just not necessarily with the same exit code as the child process. I also have no idea if this is actually a reliable way to detect watch mode.Validations
The text was updated successfully, but these errors were encountered: