fix(ts): fix nuxt-ts binary when running nuxt commands (#4844)

This commit is contained in:
Kevin Marrec 2019-01-24 11:54:00 +01:00 committed by Pooya Parsa
parent fc91b2efb2
commit 6e60aa49b8

View File

@ -3,7 +3,8 @@
// Globally indicate we are running in ts mode
process.env.NUXT_TS = 'true'
const rootDir = (process.argv[2] && process.argv[2] !== 'dev') ? process.argv[2] : process.cwd()
const nuxtCommands = ['dev', 'build', 'generate', 'start']
const rootDir = (process.argv[2] && !nuxtCommands.includes(process.argv[2])) ? process.argv[2] : process.cwd()
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''