Skip to content

Commit

Permalink
fix: Exit Code returns 0 for failed builds, closes #606
Browse files Browse the repository at this point in the history
  • Loading branch information
EGOIST committed Apr 12, 2022
1 parent b7cf552 commit b3ad95f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -63,7 +63,7 @@
"svelte": "3.46.4",
"ts-essentials": "9.1.2",
"tsconfig-paths": "3.12.0",
"tsup": "5.12.2",
"tsup": "5.12.4",
"typescript": "4.6.3",
"vitest": "0.8.4",
"wait-for-expect": "3.0.2"
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/index.ts
Expand Up @@ -161,10 +161,8 @@ export async function build(_options: Options) {
})
worker.on('message', (data) => {
if (data === 'error') {
process.exitCode = 1
reject(new Error('Failed to bundle declaration files'))
reject(new Error('error occured in dts build'))
} else if (data === 'success') {
process.exitCode = 0
resolve()
}
})
Expand Down
8 changes: 6 additions & 2 deletions src/rollup.ts
Expand Up @@ -243,8 +243,12 @@ const startRollup = async (options: NormalizedOptions) => {
if (options.watch) {
watchRollup(config)
} else {
await runRollup(config)
parentPort?.postMessage('success')
try {
await runRollup(config)
parentPort?.postMessage('success')
} catch (error) {
parentPort?.postMessage('error')
}
parentPort?.close()
}
}
Expand Down

1 comment on commit b3ad95f

@vercel
Copy link

@vercel vercel bot commented on b3ad95f Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tsup – ./

tsup.vercel.app
tsup-egoist.vercel.app
tsup.egoist.sh
tsup-git-main-egoist.vercel.app

Please sign in to comment.