Nuxt/packages/cli/src/commands/index.js

16 lines
384 B
JavaScript
Raw Normal View History

const commands = {
start: () => import('./start'),
dev: () => import('./dev'),
build: () => import('./build'),
generate: () => import('./generate'),
2020-03-02 18:15:00 +00:00
webpack: () => import('./webpack'),
help: () => import('./help')
}
export default function getCommand (name) {
if (!commands[name]) {
return Promise.resolve(null)
}
return commands[name]().then(m => m.default)
}