UNPKG

387 BPlain TextView Raw
1#!/usr/bin/env node
2
3const join = require('path').join
4require('../lib/common/cli/errors')
5
6const defaultCommand = 'dev'
7const commands = new Set([
8 defaultCommand,
9 'init',
10 'build',
11 'start',
12 'generate'
13])
14
15var cmd = process.argv[2]
16
17if (commands.has(cmd)) {
18 process.argv.splice(2, 1)
19} else {
20 cmd = defaultCommand
21}
22
23const bin = join(__dirname, 'nuxt-' + cmd)
24
25require(bin)