UNPKG

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