UNPKG

1.03 kBJavaScriptView Raw
1/*!
2 * @nuxt/cli v2.12.0 (c) 2016-2020
3
4 * - All the amazing contributors
5 * Released under the MIT License.
6 * Website: https://nuxtjs.org
7*/
8'use strict';
9
10const index = require('./cli-index.js');
11require('path');
12require('@nuxt/config');
13require('exit');
14require('@nuxt/utils');
15require('chalk');
16require('std-env');
17require('wrap-ansi');
18require('boxen');
19require('consola');
20require('minimist');
21require('hable');
22require('fs');
23require('execa');
24require('pretty-bytes');
25const banner = require('./cli-banner.js');
26
27const start = {
28 name: 'start',
29 description: 'Start the application in production mode (the application should be compiled with `nuxt build` first)',
30 usage: 'start <dir>',
31 options: {
32 ...index.common,
33 ...index.server
34 },
35 async run (cmd) {
36 const config = await cmd.getNuxtConfig({ dev: false, _start: true });
37 const nuxt = await cmd.getNuxt(config);
38
39 // Listen and show ready banner
40 await nuxt.server.listen();
41 banner.showBanner(nuxt);
42 }
43};
44
45exports.default = start;