fix(nuxt-ts): error catch in nuxt-ts binary (#5086)

* fix: nuxt-ts binary error catch

* test: update cli snapshot
This commit is contained in:
Kevin Marrec 2019-02-25 21:09:26 +01:00 committed by Sébastien Chopin
parent 4b82aa9d84
commit 4f887f6963
2 changed files with 20 additions and 18 deletions

View File

@ -11,9 +11,11 @@ const tsConfigPath = resolve(rootDir, 'tsconfig.json')
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/typescript' + suffix).setup(tsConfigPath).then(() => {
require('@nuxt/cli' + suffix).run()
}).catch((error) => {
const errorHandler = (error) => {
require('consola').fatal(error)
process.exit(2)
})
}
require('@nuxt/typescript' + suffix).setup(tsConfigPath).then(() => {
require('@nuxt/cli' + suffix).run().catch(errorHandler)
}).catch(errorHandler)