Skip to content

Commit

Permalink
fix: log build errors in development mode (#232)
Browse files Browse the repository at this point in the history
Fixes #231
  • Loading branch information
chrispcampbell authored Sep 19, 2022
1 parent e96bc83 commit f0a567b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/build/src/build/impl/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ export function watch(config: ResolvedConfig, userConfig: UserConfig, plugins: P
abortSignal: currentBuildState.abortController.signal
}
buildOnce(config, userConfig, plugins, buildOptions)
.then(result => {
// Log the error message in case of error result
if (result.isErr()) {
logError(result.error)
}
})
.catch(e => {
// Also catch thrown errors that may have not already been
// handled by `buildOnce`
logError(e)
// log('info', 'Waiting for changes...')
})
Expand Down

0 comments on commit f0a567b

Please sign in to comment.