Fix vite quitting if custom handler implemented

This commit is contained in:
Joseph Garrone
2024-10-06 22:55:18 +02:00
parent 12534e57ad
commit f6b48c88b9
8 changed files with 111 additions and 110 deletions

View File

@ -16,11 +16,11 @@ assert<Equals<ApiVersion, "v1">>();
export function maybeDelegateCommandToCustomHandler(params: {
commandName: CommandName;
buildContext: BuildContext;
}) {
}): { hasBeenHandled: boolean } {
const { commandName, buildContext } = params;
if (!fs.readdirSync(pathDirname(process.argv[1])).includes(BIN_NAME)) {
return;
return { hasBeenHandled: false };
}
try {
@ -36,11 +36,11 @@ export function maybeDelegateCommandToCustomHandler(params: {
const status = error.status;
if (status === NOT_IMPLEMENTED_EXIT_CODE) {
return;
return { hasBeenHandled: false };
}
process.exit(status);
}
process.exit(0);
return { hasBeenHandled: true };
}