webpack-dev-server 3.1.6 → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/bin/options.js +164 -0
- package/bin/utils.js +114 -0
- package/bin/webpack-dev-server.js +244 -328
- package/lib/Server.js +381 -208
- package/lib/options.json +354 -0
- package/lib/utils/addEntries.js +55 -0
- package/lib/utils/createCertificate.js +65 -0
- package/lib/utils/createDomain.js +35 -0
- package/lib/utils/createLogger.js +26 -0
- package/package.json +3 -2
- package/ssl/server.pem +39 -39
- package/lib/OptionsValidationError.js +0 -152
- package/lib/createLog.js +0 -19
- package/lib/optionsSchema.json +0 -350
- package/lib/util/addDevServerEntrypoints.js +0 -44
- package/lib/util/createDomain.js +0 -23
package/lib/options.json
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"hot": {
|
|
5
|
+
"type": "boolean"
|
|
6
|
+
},
|
|
7
|
+
"hotOnly": {
|
|
8
|
+
"type": "boolean"
|
|
9
|
+
},
|
|
10
|
+
"lazy": {
|
|
11
|
+
"type": "boolean"
|
|
12
|
+
},
|
|
13
|
+
"bonjour": {
|
|
14
|
+
"type": "boolean"
|
|
15
|
+
},
|
|
16
|
+
"host": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"allowedHosts": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"filename": {
|
|
26
|
+
"anyOf": [
|
|
27
|
+
{
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"instanceof": "RegExp"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"instanceof": "Function"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"publicPath": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"port": {
|
|
42
|
+
"anyOf": [
|
|
43
|
+
{
|
|
44
|
+
"type": "number"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"socket": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"watchOptions": {
|
|
55
|
+
"type": "object"
|
|
56
|
+
},
|
|
57
|
+
"headers": {
|
|
58
|
+
"type": "object"
|
|
59
|
+
},
|
|
60
|
+
"logLevel": {
|
|
61
|
+
"enum": [
|
|
62
|
+
"info",
|
|
63
|
+
"warn",
|
|
64
|
+
"error",
|
|
65
|
+
"debug",
|
|
66
|
+
"trace",
|
|
67
|
+
"silent"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"clientLogLevel": {
|
|
71
|
+
"enum": [
|
|
72
|
+
"none",
|
|
73
|
+
"info",
|
|
74
|
+
"error",
|
|
75
|
+
"warning"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"overlay": {
|
|
79
|
+
"anyOf": [
|
|
80
|
+
{
|
|
81
|
+
"type": "boolean"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {
|
|
86
|
+
"errors": {
|
|
87
|
+
"type": "boolean"
|
|
88
|
+
},
|
|
89
|
+
"warnings": {
|
|
90
|
+
"type": "boolean"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"progress": {
|
|
97
|
+
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"key": {
|
|
100
|
+
"anyOf": [
|
|
101
|
+
{
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"instanceof": "Buffer"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"cert": {
|
|
110
|
+
"anyOf": [
|
|
111
|
+
{
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"instanceof": "Buffer"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"ca": {
|
|
120
|
+
"anyOf": [
|
|
121
|
+
{
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"instanceof": "Buffer"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"pfx": {
|
|
130
|
+
"anyOf": [
|
|
131
|
+
{
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"instanceof": "Buffer"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"pfxPassphrase": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"requestCert": {
|
|
143
|
+
"type": "boolean"
|
|
144
|
+
},
|
|
145
|
+
"inline": {
|
|
146
|
+
"type": "boolean"
|
|
147
|
+
},
|
|
148
|
+
"disableHostCheck": {
|
|
149
|
+
"type": "boolean"
|
|
150
|
+
},
|
|
151
|
+
"public": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"https": {
|
|
155
|
+
"anyOf": [
|
|
156
|
+
{
|
|
157
|
+
"type": "object"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "boolean"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"contentBase": {
|
|
165
|
+
"anyOf": [
|
|
166
|
+
{
|
|
167
|
+
"enum": [
|
|
168
|
+
false
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "number"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"type": "array",
|
|
179
|
+
"items": {
|
|
180
|
+
"type": "string"
|
|
181
|
+
},
|
|
182
|
+
"minItems": 1
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
"watchContentBase": {
|
|
187
|
+
"type": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"open": {
|
|
190
|
+
"anyOf": [
|
|
191
|
+
{
|
|
192
|
+
"type": "string"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"type": "boolean"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"useLocalIp": {
|
|
200
|
+
"type": "boolean"
|
|
201
|
+
},
|
|
202
|
+
"openPage": {
|
|
203
|
+
"type": "string"
|
|
204
|
+
},
|
|
205
|
+
"features": {
|
|
206
|
+
"type": "array",
|
|
207
|
+
"items": {
|
|
208
|
+
"type": "string"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"compress": {
|
|
212
|
+
"type": "boolean"
|
|
213
|
+
},
|
|
214
|
+
"proxy": {
|
|
215
|
+
"anyOf": [
|
|
216
|
+
{
|
|
217
|
+
"type": "object"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "array",
|
|
221
|
+
"items": {
|
|
222
|
+
"anyOf": [
|
|
223
|
+
{
|
|
224
|
+
"type": "object"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"instanceof": "Function"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"minItems": 1
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"historyApiFallback": {
|
|
236
|
+
"anyOf": [
|
|
237
|
+
{
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"type": "object"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
"staticOptions": {
|
|
246
|
+
"type": "object"
|
|
247
|
+
},
|
|
248
|
+
"setup": {
|
|
249
|
+
"instanceof": "Function"
|
|
250
|
+
},
|
|
251
|
+
"before": {
|
|
252
|
+
"instanceof": "Function"
|
|
253
|
+
},
|
|
254
|
+
"after": {
|
|
255
|
+
"instanceof": "Function"
|
|
256
|
+
},
|
|
257
|
+
"stats": {
|
|
258
|
+
"anyOf": [
|
|
259
|
+
{
|
|
260
|
+
"type": "object"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"type": "boolean"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"enum": [
|
|
267
|
+
"none",
|
|
268
|
+
"errors-only",
|
|
269
|
+
"minimal",
|
|
270
|
+
"normal",
|
|
271
|
+
"verbose"
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
"reporter": {
|
|
277
|
+
"instanceof": "Function"
|
|
278
|
+
},
|
|
279
|
+
"logTime": {
|
|
280
|
+
"type": "boolean"
|
|
281
|
+
},
|
|
282
|
+
"noInfo": {
|
|
283
|
+
"type": "boolean"
|
|
284
|
+
},
|
|
285
|
+
"quiet": {
|
|
286
|
+
"type": "boolean"
|
|
287
|
+
},
|
|
288
|
+
"serverSideRender": {
|
|
289
|
+
"type": "boolean"
|
|
290
|
+
},
|
|
291
|
+
"index": {
|
|
292
|
+
"type": "string"
|
|
293
|
+
},
|
|
294
|
+
"log": {
|
|
295
|
+
"instanceof": "Function"
|
|
296
|
+
},
|
|
297
|
+
"warn": {
|
|
298
|
+
"instanceof": "Function"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"errorMessage": {
|
|
302
|
+
"properties": {
|
|
303
|
+
"hot": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hot)",
|
|
304
|
+
"hotOnly": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hotonly)",
|
|
305
|
+
"lazy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-lazy-)",
|
|
306
|
+
"bonjour": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-bonjour)",
|
|
307
|
+
"publicPath": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-publicpath-)",
|
|
308
|
+
"host": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-host)",
|
|
309
|
+
"allowedHosts": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-allowedhosts)",
|
|
310
|
+
"logLevel": "should be {String} and equal to one of the allowed values\n\n [ 'trace', 'debug', 'info', 'warn', 'error', 'silent' ]\n\n(https://webpack.js.org/configuration/dev-server/#devserver-loglevel)",
|
|
311
|
+
"filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserver-filename-)",
|
|
312
|
+
"port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)",
|
|
313
|
+
"socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)",
|
|
314
|
+
"watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)",
|
|
315
|
+
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)",
|
|
316
|
+
"clientLogLevel": "should be {String} and equal to one of the allowed values\n\n [ 'trace', 'debug', 'info', 'warn', 'error', 'silent' ]\n\n(https://webpack.js.org/configuration/dev-server/#devserver-clientloglevel)",
|
|
317
|
+
"overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)",
|
|
318
|
+
"progress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-progress-cli-only)",
|
|
319
|
+
"key": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-key)",
|
|
320
|
+
"cert": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-cert)",
|
|
321
|
+
"ca": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-ca)",
|
|
322
|
+
"pfx": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-pfx)",
|
|
323
|
+
"pfxPassphrase": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-pfxpassphrase)",
|
|
324
|
+
"requestCert": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-requestcert)",
|
|
325
|
+
"inline": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-inline)",
|
|
326
|
+
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-disablehostcheck)",
|
|
327
|
+
"public": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-public)",
|
|
328
|
+
"https": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-https)",
|
|
329
|
+
"contentBase": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-contentbase)",
|
|
330
|
+
"watchContentBase": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-watchcontentbase)",
|
|
331
|
+
"open": "should be {String|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-open)",
|
|
332
|
+
"useLocalIp": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-uselocalip)",
|
|
333
|
+
"openPage": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-openpage)",
|
|
334
|
+
"features": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-features)",
|
|
335
|
+
"compress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-compress)",
|
|
336
|
+
"proxy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hot)",
|
|
337
|
+
"historyApiFallback": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-historyapifallback)",
|
|
338
|
+
"staticOptions": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-staticOptions)",
|
|
339
|
+
"setup": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-setup)",
|
|
340
|
+
"before": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-before)",
|
|
341
|
+
"after": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-after)",
|
|
342
|
+
"stats": "should be {Boolean|Object|String} (https://webpack.js.org/configuration/dev-server/#devserver-stats-)",
|
|
343
|
+
"reporter": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-reporter)",
|
|
344
|
+
"logTime": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-logtime)",
|
|
345
|
+
"noInfo": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-noinfo-)",
|
|
346
|
+
"quiet": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-quiet-)",
|
|
347
|
+
"serverSideRender": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-serversiderender)",
|
|
348
|
+
"index": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-index)",
|
|
349
|
+
"log": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-log)",
|
|
350
|
+
"warn": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-warn)"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"additionalProperties": false
|
|
354
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable
|
|
4
|
+
no-shadow,
|
|
5
|
+
no-param-reassign,
|
|
6
|
+
array-bracket-spacing,
|
|
7
|
+
space-before-function-paren
|
|
8
|
+
*/
|
|
9
|
+
const createDomain = require('./createDomain');
|
|
10
|
+
|
|
11
|
+
function addEntries (config, options, server) {
|
|
12
|
+
if (options.inline !== false) {
|
|
13
|
+
// we're stubbing the app in this method as it's static and doesn't require
|
|
14
|
+
// a server to be supplied. createDomain requires an app with the
|
|
15
|
+
// address() signature.
|
|
16
|
+
const app = server || {
|
|
17
|
+
address() {
|
|
18
|
+
return { port: options.port };
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const domain = createDomain(options, app);
|
|
23
|
+
const entries = [ `${require.resolve('../../client/')}?${domain}` ];
|
|
24
|
+
|
|
25
|
+
if (options.hotOnly) {
|
|
26
|
+
entries.push(require.resolve('webpack/hot/only-dev-server'));
|
|
27
|
+
} else if (options.hot) {
|
|
28
|
+
entries.push(require.resolve('webpack/hot/dev-server'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const prependEntry = (entry) => {
|
|
32
|
+
if (typeof entry === 'function') {
|
|
33
|
+
return () => Promise.resolve(entry()).then(prependEntry);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof entry === 'object' && !Array.isArray(entry)) {
|
|
37
|
+
const clone = {};
|
|
38
|
+
|
|
39
|
+
Object.keys(entry).forEach((key) => {
|
|
40
|
+
clone[key] = entries.concat(entry[key]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return clone;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return entries.concat(entry);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
[].concat(config).forEach((config) => {
|
|
50
|
+
config.entry = prependEntry(config.entry || './src');
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = addEntries;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable
|
|
4
|
+
space-before-function-paren
|
|
5
|
+
*/
|
|
6
|
+
const selfsigned = require('selfsigned');
|
|
7
|
+
|
|
8
|
+
function createCertificate (attrs) {
|
|
9
|
+
return selfsigned.generate(attrs, {
|
|
10
|
+
algorithm: 'sha256',
|
|
11
|
+
days: 30,
|
|
12
|
+
keySize: 2048,
|
|
13
|
+
extensions: [
|
|
14
|
+
{
|
|
15
|
+
name: 'basicConstraints',
|
|
16
|
+
cA: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'keyUsage',
|
|
20
|
+
keyCertSign: true,
|
|
21
|
+
digitalSignature: true,
|
|
22
|
+
nonRepudiation: true,
|
|
23
|
+
keyEncipherment: true,
|
|
24
|
+
dataEncipherment: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'subjectAltName',
|
|
28
|
+
altNames: [
|
|
29
|
+
{
|
|
30
|
+
// type 2 is DNS
|
|
31
|
+
type: 2,
|
|
32
|
+
value: 'localhost'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 2,
|
|
36
|
+
value: 'localhost.localdomain'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 2,
|
|
40
|
+
value: 'lvh.me'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 2,
|
|
44
|
+
value: '*.lvh.me'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 2,
|
|
48
|
+
value: '[::1]'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
// type 7 is IP
|
|
52
|
+
type: 7,
|
|
53
|
+
ip: '127.0.0.1'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 7,
|
|
57
|
+
ip: 'fe80::1'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = createCertificate;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable
|
|
4
|
+
no-nested-ternary,
|
|
5
|
+
multiline-ternary,
|
|
6
|
+
space-before-function-paren
|
|
7
|
+
*/
|
|
8
|
+
const url = require('url');
|
|
9
|
+
const ip = require('internal-ip');
|
|
10
|
+
|
|
11
|
+
function createDomain (options, server) {
|
|
12
|
+
const protocol = options.https ? 'https' : 'http';
|
|
13
|
+
const hostname = options.useLocalIp ? ip.v4.sync() || 'localhost' : options.host;
|
|
14
|
+
|
|
15
|
+
const port = options.socket
|
|
16
|
+
? 0
|
|
17
|
+
: server
|
|
18
|
+
? server.address().port
|
|
19
|
+
: 0;
|
|
20
|
+
// use explicitly defined public url
|
|
21
|
+
// (prefix with protocol if not explicitly given)
|
|
22
|
+
if (options.public) {
|
|
23
|
+
return /^[a-zA-Z]+:\/\//.test(options.public)
|
|
24
|
+
? `${options.public}`
|
|
25
|
+
: `${protocol}://${options.public}`;
|
|
26
|
+
}
|
|
27
|
+
// the formatted domain (url without path) of the webpack server
|
|
28
|
+
return url.format({
|
|
29
|
+
protocol,
|
|
30
|
+
hostname,
|
|
31
|
+
port
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = createDomain;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable
|
|
4
|
+
space-before-function-paren
|
|
5
|
+
*/
|
|
6
|
+
const log = require('webpack-log');
|
|
7
|
+
|
|
8
|
+
function createLogger (options) {
|
|
9
|
+
let level = options.logLevel || 'info';
|
|
10
|
+
|
|
11
|
+
if (options.quiet === true) {
|
|
12
|
+
level = 'silent';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (options.noInfo === true) {
|
|
16
|
+
level = 'warn';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return log({
|
|
20
|
+
name: 'wds',
|
|
21
|
+
level,
|
|
22
|
+
timestamp: options.logTime
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = createLogger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-server",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "Serves a webpack app. Updates the browser on changes.",
|
|
5
5
|
"bin": "bin/webpack-dev-server.js",
|
|
6
6
|
"main": "lib/Server.js",
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"html-entities": "^1.2.0",
|
|
37
37
|
"http-proxy-middleware": "~0.18.0",
|
|
38
38
|
"import-local": "^1.0.0",
|
|
39
|
-
"internal-ip": "
|
|
39
|
+
"internal-ip": "^3.0.1",
|
|
40
40
|
"ip": "^1.1.5",
|
|
41
41
|
"killable": "^1.0.0",
|
|
42
42
|
"loglevel": "^1.4.1",
|
|
43
43
|
"opn": "^5.1.0",
|
|
44
44
|
"portfinder": "^1.0.9",
|
|
45
|
+
"schema-utils": "^1.0.0",
|
|
45
46
|
"selfsigned": "^1.9.1",
|
|
46
47
|
"serve-index": "^1.7.2",
|
|
47
48
|
"sockjs": "0.3.19",
|
package/ssl/server.pem
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
-----BEGIN RSA PRIVATE KEY-----
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
+
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
MIIEowIBAAKCAQEAr19R4H87sZonIp+VpwyTSrAhbq7jXy83Qz6DihCaiNTQnNRE
|
|
3
|
+
A9qoutlSubBLBlcvgDjBh8Jy9jA3oebzIdBFsGeuKL3zhT3wwZO05S9oQo48oz9b
|
|
4
|
+
OoqbOsUbFrU/MDkJKShnDAIoPUODpKkwLzBOL43S17G/Io/b3SPzElBoiOU3i4qe
|
|
5
|
+
UJut5dysih9grkNp/6My+ajv/8gU0RXLAwExOql4dz+QSVVa49Yc45Qj1CMzXmBd
|
|
6
|
+
MOS2O2a/dwqXnuBmMOu24uzQyfKSZgJc2af/VRtolCQsVN7JbSPOSXb46S/iww5Q
|
|
7
|
+
zSZMDm+ycNfWefFH/rMUv4VMNUJKdE+jl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