1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | 'use strict';
|
9 |
|
10 | const index = require('./cli-index.js');
|
11 | require('path');
|
12 | require('@nuxt/config');
|
13 | require('exit');
|
14 | require('@nuxt/utils');
|
15 | require('chalk');
|
16 | require('std-env');
|
17 | require('wrap-ansi');
|
18 | require('boxen');
|
19 | require('consola');
|
20 | require('minimist');
|
21 | require('hable');
|
22 | require('fs');
|
23 | require('execa');
|
24 | require('pretty-bytes');
|
25 | const banner = require('./cli-banner.js');
|
26 |
|
27 | const 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 |
|
40 | await nuxt.server.listen();
|
41 | banner.showBanner(nuxt);
|
42 | }
|
43 | };
|
44 |
|
45 | exports.default = start;
|