1 |
3a515b92
|
cagy
|
'use strict';
|
2 |
|
|
|
3 |
|
|
const ADVANCED_GROUP = 'Advanced options:';
|
4 |
|
|
const DISPLAY_GROUP = 'Stats options:';
|
5 |
|
|
const SSL_GROUP = 'SSL options:';
|
6 |
|
|
const CONNECTION_GROUP = 'Connection options:';
|
7 |
|
|
const RESPONSE_GROUP = 'Response options:';
|
8 |
|
|
const BASIC_GROUP = 'Basic options:';
|
9 |
|
|
|
10 |
|
|
module.exports = {
|
11 |
|
|
devServer: [
|
12 |
|
|
{
|
13 |
|
|
name: 'bonjour',
|
14 |
|
|
type: Boolean,
|
15 |
|
|
describe: 'Broadcasts the server via ZeroConf networking on start',
|
16 |
|
|
},
|
17 |
|
|
{
|
18 |
|
|
name: 'lazy',
|
19 |
|
|
type: Boolean,
|
20 |
|
|
describe: 'Lazy',
|
21 |
|
|
},
|
22 |
|
|
{
|
23 |
|
|
name: 'liveReload',
|
24 |
|
|
type: Boolean,
|
25 |
|
|
defaultValue: true,
|
26 |
|
|
describe: 'Enables/Disables live reloading on changing files',
|
27 |
|
|
},
|
28 |
|
|
{
|
29 |
|
|
name: 'serveIndex',
|
30 |
|
|
type: Boolean,
|
31 |
|
|
describe: 'Enables/Disables serveIndex middleware',
|
32 |
|
|
defaultValue: true,
|
33 |
|
|
},
|
34 |
|
|
{
|
35 |
|
|
name: 'inline',
|
36 |
|
|
type: Boolean,
|
37 |
|
|
defaultValue: true,
|
38 |
|
|
describe:
|
39 |
|
|
'Inline mode (set to false to disable including client scripts like livereload)',
|
40 |
|
|
},
|
41 |
|
|
{
|
42 |
|
|
name: 'profile',
|
43 |
|
|
type: Boolean,
|
44 |
|
|
describe: 'Print compilation profile data for progress steps',
|
45 |
|
|
},
|
46 |
|
|
{
|
47 |
|
|
name: 'progress',
|
48 |
|
|
type: Boolean,
|
49 |
|
|
describe: 'Print compilation progress in percentage',
|
50 |
|
|
group: BASIC_GROUP,
|
51 |
|
|
},
|
52 |
|
|
{
|
53 |
|
|
name: 'hot-only',
|
54 |
|
|
type: Boolean,
|
55 |
|
|
describe: 'Do not refresh page if HMR fails',
|
56 |
|
|
group: ADVANCED_GROUP,
|
57 |
|
|
},
|
58 |
|
|
{
|
59 |
|
|
name: 'stdin',
|
60 |
|
|
type: Boolean,
|
61 |
|
|
describe: 'close when stdin ends',
|
62 |
|
|
},
|
63 |
|
|
{
|
64 |
|
|
name: 'open',
|
65 |
|
|
type: String,
|
66 |
|
|
describe:
|
67 |
|
|
'Open the default browser, or optionally specify a browser name',
|
68 |
|
|
},
|
69 |
|
|
{
|
70 |
|
|
name: 'useLocalIp',
|
71 |
|
|
type: Boolean,
|
72 |
|
|
describe: 'Open default browser with local IP',
|
73 |
|
|
},
|
74 |
|
|
{
|
75 |
|
|
name: 'open-page',
|
76 |
|
|
type: String,
|
77 |
|
|
describe: 'Open default browser with the specified page',
|
78 |
|
|
},
|
79 |
|
|
{
|
80 |
|
|
name: 'client-log-level',
|
81 |
|
|
type: String,
|
82 |
|
|
group: DISPLAY_GROUP,
|
83 |
|
|
defaultValue: 'info',
|
84 |
|
|
describe:
|
85 |
|
|
'Log level in the browser (trace, debug, info, warn, error or silent)',
|
86 |
|
|
},
|
87 |
|
|
{
|
88 |
|
|
name: 'https',
|
89 |
|
|
type: Boolean,
|
90 |
|
|
group: SSL_GROUP,
|
91 |
|
|
describe: 'HTTPS',
|
92 |
|
|
},
|
93 |
|
|
{
|
94 |
|
|
name: 'http2',
|
95 |
|
|
type: Boolean,
|
96 |
|
|
group: SSL_GROUP,
|
97 |
|
|
describe: 'HTTP/2, must be used with HTTPS',
|
98 |
|
|
},
|
99 |
|
|
{
|
100 |
|
|
name: 'key',
|
101 |
|
|
type: String,
|
102 |
|
|
describe: 'Path to a SSL key.',
|
103 |
|
|
group: SSL_GROUP,
|
104 |
|
|
},
|
105 |
|
|
{
|
106 |
|
|
name: 'cert',
|
107 |
|
|
type: String,
|
108 |
|
|
describe: 'Path to a SSL certificate.',
|
109 |
|
|
group: SSL_GROUP,
|
110 |
|
|
},
|
111 |
|
|
{
|
112 |
|
|
name: 'cacert',
|
113 |
|
|
type: String,
|
114 |
|
|
describe: 'Path to a SSL CA certificate.',
|
115 |
|
|
group: SSL_GROUP,
|
116 |
|
|
},
|
117 |
|
|
{
|
118 |
|
|
name: 'pfx',
|
119 |
|
|
type: String,
|
120 |
|
|
describe: 'Path to a SSL pfx file.',
|
121 |
|
|
group: SSL_GROUP,
|
122 |
|
|
},
|
123 |
|
|
{
|
124 |
|
|
name: 'pfx-passphrase',
|
125 |
|
|
type: String,
|
126 |
|
|
describe: 'Passphrase for pfx file.',
|
127 |
|
|
group: SSL_GROUP,
|
128 |
|
|
},
|
129 |
|
|
{
|
130 |
|
|
name: 'content-base',
|
131 |
|
|
type: String,
|
132 |
|
|
describe: 'A directory or URL to serve HTML content from.',
|
133 |
|
|
group: RESPONSE_GROUP,
|
134 |
|
|
},
|
135 |
|
|
{
|
136 |
|
|
name: 'watch-content-base',
|
137 |
|
|
type: Boolean,
|
138 |
|
|
describe: 'Enable live-reloading of the content-base.',
|
139 |
|
|
group: RESPONSE_GROUP,
|
140 |
|
|
},
|
141 |
|
|
{
|
142 |
|
|
name: 'history-api-fallback',
|
143 |
|
|
type: Boolean,
|
144 |
|
|
describe: 'Fallback to /index.html for Single Page Applications.',
|
145 |
|
|
group: RESPONSE_GROUP,
|
146 |
|
|
},
|
147 |
|
|
{
|
148 |
|
|
name: 'compress',
|
149 |
|
|
type: Boolean,
|
150 |
|
|
describe: 'Enable gzip compression',
|
151 |
|
|
group: RESPONSE_GROUP,
|
152 |
|
|
},
|
153 |
|
|
// findPort is currently not set up
|
154 |
|
|
{
|
155 |
|
|
name: 'port',
|
156 |
|
|
type: Number,
|
157 |
|
|
describe: 'The port',
|
158 |
|
|
group: CONNECTION_GROUP,
|
159 |
|
|
},
|
160 |
|
|
{
|
161 |
|
|
name: 'disable-host-check',
|
162 |
|
|
type: Boolean,
|
163 |
|
|
describe: 'Will not check the host',
|
164 |
|
|
group: CONNECTION_GROUP,
|
165 |
|
|
},
|
166 |
|
|
{
|
167 |
|
|
name: 'socket',
|
168 |
|
|
type: String,
|
169 |
|
|
describe: 'Socket to listen',
|
170 |
|
|
group: CONNECTION_GROUP,
|
171 |
|
|
},
|
172 |
|
|
{
|
173 |
|
|
name: 'public',
|
174 |
|
|
type: String,
|
175 |
|
|
describe: 'The public hostname/ip address of the server',
|
176 |
|
|
group: CONNECTION_GROUP,
|
177 |
|
|
},
|
178 |
|
|
{
|
179 |
|
|
name: 'host',
|
180 |
|
|
type: String,
|
181 |
|
|
describe: 'The hostname/ip address the server will bind to',
|
182 |
|
|
group: CONNECTION_GROUP,
|
183 |
|
|
},
|
184 |
|
|
// use command-line-args "multiple" option, allowing the usage: --allowed-hosts host1 host2 host3
|
185 |
|
|
// instead of the old, comma-separated syntax: --allowed-hosts host1,host2,host3
|
186 |
|
|
{
|
187 |
|
|
name: 'allowed-hosts',
|
188 |
|
|
type: String,
|
189 |
|
|
describe:
|
190 |
|
|
'A list of hosts that are allowed to access the dev server, separated by spaces',
|
191 |
|
|
group: CONNECTION_GROUP,
|
192 |
|
|
multiple: true,
|
193 |
|
|
},
|
194 |
|
|
],
|
195 |
|
|
};
|