Nuxt/bin/nuxt
2018-01-11 17:41:49 +03:30

24 lines
510 B
JavaScript
Executable File

#!/usr/bin/env node
const { join } = require('path')
const { logError } = require('../lib/common/utils')
// Global error handler
process.on('unhandledRejection', _error => {
logError(_error) // eslint-disable no-console
})
const defaultCommand = 'dev'
const commands = new Set([defaultCommand, 'init', 'build', 'start', 'generate'])
var cmd = process.argv[2]
if (commands.has(cmd)) {
process.argv.splice(2, 1)
} else {
cmd = defaultCommand
}
const bin = join(__dirname, 'nuxt-' + cmd)
require(bin)