Skip to content

Commit

Permalink
fix: unset service when stopping esbuild service
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 26, 2020
1 parent ec7401f commit dd0205f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/node/esbuildService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const ensureService = async () => {

export const stopService = () => {
_service && _service.stop()
_service = undefined
}

const sourceMapRE = /\/\/# sourceMappingURL.*/
Expand Down Expand Up @@ -95,7 +96,11 @@ export const transform = async (
console.error(
chalk.red(`[vite] error while transforming ${file} with esbuild:`)
)
e.errors.forEach((m: Message) => printMessage(m, src))
if (e.errors) {
e.errors.forEach((m: Message) => printMessage(m, src))
} else {
console.error(e)
}
debug(`options used: `, options)
return {
code: '',
Expand Down

0 comments on commit dd0205f

Please sign in to comment.