UNPKG

4 kBJavaScriptView Raw
1'use strict';
2
3/* eslint-disable
4 global-require,
5 multiline-ternary,
6 space-before-function-paren
7*/
8const ADVANCED_GROUP = 'Advanced options:';
9const DISPLAY_GROUP = 'Stats options:';
10const SSL_GROUP = 'SSL options:';
11const CONNECTION_GROUP = 'Connection options:';
12const RESPONSE_GROUP = 'Response options:';
13const BASIC_GROUP = 'Basic options:';
14
15const options = {
16 bonjour: {
17 type: 'boolean',
18 describe: 'Broadcasts the server via ZeroConf networking on start',
19 },
20 lazy: {
21 type: 'boolean',
22 describe: 'Lazy',
23 },
24 inline: {
25 type: 'boolean',
26 default: true,
27 describe:
28 'Inline mode (set to false to disable including client scripts like livereload)',
29 },
30 progress: {
31 type: 'boolean',
32 describe: 'Print compilation progress in percentage',
33 group: BASIC_GROUP,
34 },
35 'hot-only': {
36 type: 'boolean',
37 describe: 'Do not refresh page if HMR fails',
38 group: ADVANCED_GROUP,
39 },
40 stdin: {
41 type: 'boolean',
42 describe: 'close when stdin ends',
43 },
44 open: {
45 type: 'string',
46 describe: 'Open the default browser, or optionally specify a browser name',
47 },
48 useLocalIp: {
49 type: 'boolean',
50 describe: 'Open default browser with local IP',
51 },
52 'open-page': {
53 type: 'string',
54 describe: 'Open default browser with the specified page',
55 requiresArg: true,
56 },
57 color: {
58 type: 'boolean',
59 alias: 'colors',
60 default: function supportsColor() {
61 // Use `require('supports-color').stdout` for supports-color >= 5.0.0.
62 // See https://github.com/webpack/webpack-dev-server/pull/1555.
63 return require('supports-color').stdout;
64 },
65 group: DISPLAY_GROUP,
66 describe: 'Enables/Disables colors on the console',
67 },
68 info: {
69 type: 'boolean',
70 group: DISPLAY_GROUP,
71 default: true,
72 describe: 'Info',
73 },
74 quiet: {
75 type: 'boolean',
76 group: DISPLAY_GROUP,
77 describe: 'Quiet',
78 },
79 'client-log-level': {
80 type: 'string',
81 group: DISPLAY_GROUP,
82 default: 'info',
83 describe: 'Log level in the browser (info, warning, error or none)',
84 },
85 https: {
86 type: 'boolean',
87 group: SSL_GROUP,
88 describe: 'HTTPS',
89 },
90 key: {
91 type: 'string',
92 describe: 'Path to a SSL key.',
93 group: SSL_GROUP,
94 },
95 cert: {
96 type: 'string',
97 describe: 'Path to a SSL certificate.',
98 group: SSL_GROUP,
99 },
100 cacert: {
101 type: 'string',
102 describe: 'Path to a SSL CA certificate.',
103 group: SSL_GROUP,
104 },
105 pfx: {
106 type: 'string',
107 describe: 'Path to a SSL pfx file.',
108 group: SSL_GROUP,
109 },
110 'pfx-passphrase': {
111 type: 'string',
112 describe: 'Passphrase for pfx file.',
113 group: SSL_GROUP,
114 },
115 'content-base': {
116 type: 'string',
117 describe: 'A directory or URL to serve HTML content from.',
118 group: RESPONSE_GROUP,
119 },
120 'watch-content-base': {
121 type: 'boolean',
122 describe: 'Enable live-reloading of the content-base.',
123 group: RESPONSE_GROUP,
124 },
125 'history-api-fallback': {
126 type: 'boolean',
127 describe: 'Fallback to /index.html for Single Page Applications.',
128 group: RESPONSE_GROUP,
129 },
130 compress: {
131 type: 'boolean',
132 describe: 'Enable gzip compression',
133 group: RESPONSE_GROUP,
134 },
135 port: {
136 describe: 'The port',
137 group: CONNECTION_GROUP,
138 },
139 'disable-host-check': {
140 type: 'boolean',
141 describe: 'Will not check the host',
142 group: CONNECTION_GROUP,
143 },
144 socket: {
145 type: 'String',
146 describe: 'Socket to listen',
147 group: CONNECTION_GROUP,
148 },
149 public: {
150 type: 'string',
151 describe: 'The public hostname/ip address of the server',
152 group: CONNECTION_GROUP,
153 },
154 host: {
155 type: 'string',
156 default: 'localhost',
157 describe: 'The hostname/ip address the server will bind to',
158 group: CONNECTION_GROUP,
159 },
160 'allowed-hosts': {
161 type: 'string',
162 describe:
163 'A comma-delimited string of hosts that are allowed to access the dev server',
164 group: CONNECTION_GROUP,
165 },
166};
167
168module.exports = options;