Skip to content

Commit d3f36c4

Browse files
committed
log out full error with link to github issues
1 parent af4f996 commit d3f36c4

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

packages/type-scripts/scripts/build.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env node
2+
const chalk = require("chalk")
23
const path = require("path")
34
const rollupTypescript = require("rollup-plugin-typescript2")
45
const rollup = require("rollup")
@@ -48,8 +49,20 @@ async function build() {
4849
await bundle.write(outputOptions)
4950
}
5051

51-
try {
52-
build()
53-
} catch (e) {
54-
console.error("Failed to build Typescript project", e)
55-
}
52+
build().catch(e => {
53+
console.log(chalk.red("Build Failed"))
54+
console.log()
55+
console.log(
56+
chalk.red(
57+
"If you cannot figure out what's causing this failure please create a new issue in Github:"
58+
)
59+
)
60+
console.log()
61+
console.log(
62+
`\t${chalk.cyan(
63+
"https://github.com/ncphillips/create-typescript-package/issues/new"
64+
)}`
65+
)
66+
console.log()
67+
console.error(e)
68+
})

0 commit comments

Comments
 (0)