webpack-dev-server 3.1.6 → 3.1.10

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.
@@ -0,0 +1,365 @@
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
+ "writeToDisk": {
58
+ "anyOf": [
59
+ {
60
+ "type": "boolean"
61
+ },
62
+ {
63
+ "instanceof": "Function"
64
+ }
65
+ ]
66
+ },
67
+ "headers": {
68
+ "type": "object"
69
+ },
70
+ "logLevel": {
71
+ "enum": [
72
+ "info",
73
+ "warn",
74
+ "error",
75
+ "debug",
76
+ "trace",
77
+ "silent"
78
+ ]
79
+ },
80
+ "clientLogLevel": {
81
+ "enum": [
82
+ "none",
83
+ "info",
84
+ "error",
85
+ "warning"
86
+ ]
87
+ },
88
+ "overlay": {
89
+ "anyOf": [
90
+ {
91
+ "type": "boolean"
92
+ },
93
+ {
94
+ "type": "object",
95
+ "properties": {
96
+ "errors": {
97
+ "type": "boolean"
98
+ },
99
+ "warnings": {
100
+ "type": "boolean"
101
+ }
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ "progress": {
107
+ "type": "boolean"
108
+ },
109
+ "key": {
110
+ "anyOf": [
111
+ {
112
+ "type": "string"
113
+ },
114
+ {
115
+ "instanceof": "Buffer"
116
+ }
117
+ ]
118
+ },
119
+ "cert": {
120
+ "anyOf": [
121
+ {
122
+ "type": "string"
123
+ },
124
+ {
125
+ "instanceof": "Buffer"
126
+ }
127
+ ]
128
+ },
129
+ "ca": {
130
+ "anyOf": [
131
+ {
132
+ "type": "string"
133
+ },
134
+ {
135
+ "instanceof": "Buffer"
136
+ }
137
+ ]
138
+ },
139
+ "pfx": {
140
+ "anyOf": [
141
+ {
142
+ "type": "string"
143
+ },
144
+ {
145
+ "instanceof": "Buffer"
146
+ }
147
+ ]
148
+ },
149
+ "pfxPassphrase": {
150
+ "type": "string"
151
+ },
152
+ "requestCert": {
153
+ "type": "boolean"
154
+ },
155
+ "inline": {
156
+ "type": "boolean"
157
+ },
158
+ "disableHostCheck": {
159
+ "type": "boolean"
160
+ },
161
+ "public": {
162
+ "type": "string"
163
+ },
164
+ "https": {
165
+ "anyOf": [
166
+ {
167
+ "type": "object"
168
+ },
169
+ {
170
+ "type": "boolean"
171
+ }
172
+ ]
173
+ },
174
+ "contentBase": {
175
+ "anyOf": [
176
+ {
177
+ "enum": [
178
+ false
179
+ ]
180
+ },
181
+ {
182
+ "type": "number"
183
+ },
184
+ {
185
+ "type": "string"
186
+ },
187
+ {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "string"
191
+ },
192
+ "minItems": 1
193
+ }
194
+ ]
195
+ },
196
+ "watchContentBase": {
197
+ "type": "boolean"
198
+ },
199
+ "open": {
200
+ "anyOf": [
201
+ {
202
+ "type": "string"
203
+ },
204
+ {
205
+ "type": "boolean"
206
+ }
207
+ ]
208
+ },
209
+ "useLocalIp": {
210
+ "type": "boolean"
211
+ },
212
+ "openPage": {
213
+ "type": "string"
214
+ },
215
+ "features": {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "string"
219
+ }
220
+ },
221
+ "compress": {
222
+ "type": "boolean"
223
+ },
224
+ "proxy": {
225
+ "anyOf": [
226
+ {
227
+ "type": "object"
228
+ },
229
+ {
230
+ "type": "array",
231
+ "items": {
232
+ "anyOf": [
233
+ {
234
+ "type": "object"
235
+ },
236
+ {
237
+ "instanceof": "Function"
238
+ }
239
+ ]
240
+ },
241
+ "minItems": 1
242
+ }
243
+ ]
244
+ },
245
+ "historyApiFallback": {
246
+ "anyOf": [
247
+ {
248
+ "type": "boolean"
249
+ },
250
+ {
251
+ "type": "object"
252
+ }
253
+ ]
254
+ },
255
+ "staticOptions": {
256
+ "type": "object"
257
+ },
258
+ "setup": {
259
+ "instanceof": "Function"
260
+ },
261
+ "before": {
262
+ "instanceof": "Function"
263
+ },
264
+ "after": {
265
+ "instanceof": "Function"
266
+ },
267
+ "stats": {
268
+ "anyOf": [
269
+ {
270
+ "type": "object"
271
+ },
272
+ {
273
+ "type": "boolean"
274
+ },
275
+ {
276
+ "enum": [
277
+ "none",
278
+ "errors-only",
279
+ "minimal",
280
+ "normal",
281
+ "verbose"
282
+ ]
283
+ }
284
+ ]
285
+ },
286
+ "reporter": {
287
+ "instanceof": "Function"
288
+ },
289
+ "logTime": {
290
+ "type": "boolean"
291
+ },
292
+ "noInfo": {
293
+ "type": "boolean"
294
+ },
295
+ "quiet": {
296
+ "type": "boolean"
297
+ },
298
+ "serverSideRender": {
299
+ "type": "boolean"
300
+ },
301
+ "index": {
302
+ "type": "string"
303
+ },
304
+ "log": {
305
+ "instanceof": "Function"
306
+ },
307
+ "warn": {
308
+ "instanceof": "Function"
309
+ }
310
+ },
311
+ "errorMessage": {
312
+ "properties": {
313
+ "hot": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hot)",
314
+ "hotOnly": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hotonly)",
315
+ "lazy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-lazy-)",
316
+ "bonjour": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-bonjour)",
317
+ "publicPath": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-publicpath-)",
318
+ "host": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-host)",
319
+ "allowedHosts": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-allowedhosts)",
320
+ "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)",
321
+ "filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserver-filename-)",
322
+ "port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)",
323
+ "socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)",
324
+ "watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)",
325
+ "writeToDisk": "should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)",
326
+ "headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)",
327
+ "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)",
328
+ "overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)",
329
+ "progress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-progress-cli-only)",
330
+ "key": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-key)",
331
+ "cert": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-cert)",
332
+ "ca": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-ca)",
333
+ "pfx": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserver-pfx)",
334
+ "pfxPassphrase": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-pfxpassphrase)",
335
+ "requestCert": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-requestcert)",
336
+ "inline": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-inline)",
337
+ "disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-disablehostcheck)",
338
+ "public": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-public)",
339
+ "https": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-https)",
340
+ "contentBase": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-contentbase)",
341
+ "watchContentBase": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-watchcontentbase)",
342
+ "open": "should be {String|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-open)",
343
+ "useLocalIp": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-uselocalip)",
344
+ "openPage": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-openpage)",
345
+ "features": "should be {Array} (https://webpack.js.org/configuration/dev-server/#devserver-features)",
346
+ "compress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-compress)",
347
+ "proxy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-hot)",
348
+ "historyApiFallback": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-historyapifallback)",
349
+ "staticOptions": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-staticOptions)",
350
+ "setup": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-setup)",
351
+ "before": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-before)",
352
+ "after": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-after)",
353
+ "stats": "should be {Boolean|Object|String} (https://webpack.js.org/configuration/dev-server/#devserver-stats-)",
354
+ "reporter": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-reporter)",
355
+ "logTime": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-logtime)",
356
+ "noInfo": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-noinfo-)",
357
+ "quiet": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-quiet-)",
358
+ "serverSideRender": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-serversiderender)",
359
+ "index": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-index)",
360
+ "log": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-log)",
361
+ "warn": "should be {Function} (https://webpack.js.org/configuration/dev-server/#devserver-warn)"
362
+ }
363
+ },
364
+ "additionalProperties": false
365
+ }
@@ -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.noInfo === true) {
12
+ level = 'warn';
13
+ }
14
+
15
+ if (options.quiet === true) {
16
+ level = 'silent';
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.6",
3
+ "version": "3.1.10",
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",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "lint": "eslint bin lib test examples client-src",
18
18
  "test": "nyc --reporter lcovonly mocha --full-trace --check-leaks --exit",
19
- "prepare": "(rm ssl/*.pem || true) && npm run -s transpile:index && npm run -s build:live && npm run -s build:index && npm run -s build:sockjs",
19
+ "prepare": "rimraf ./ssl/*.pem && npm run -s transpile:index && npm run -s build:live && npm run -s build:index && npm run -s build:sockjs",
20
20
  "transpile:index": "babel client-src/default --out-dir client --ignore *.config.js",
21
21
  "build:index": "webpack ./client-src/default/index.js -o client/index.bundle.js --color --config client-src/default/webpack.config.js",
22
22
  "build:live": "webpack ./client-src/live/index.js -o client/live.bundle.js --color --config client-src/live/webpack.config.js",
@@ -35,23 +35,24 @@
35
35
  "express": "^4.16.2",
36
36
  "html-entities": "^1.2.0",
37
37
  "http-proxy-middleware": "~0.18.0",
38
- "import-local": "^1.0.0",
39
- "internal-ip": "1.2.0",
38
+ "import-local": "^2.0.0",
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",
48
- "sockjs-client": "1.1.5",
49
+ "sockjs-client": "1.3.0",
49
50
  "spdy": "^3.4.1",
50
51
  "strip-ansi": "^3.0.0",
51
52
  "supports-color": "^5.1.0",
52
- "webpack-dev-middleware": "3.2.0",
53
+ "webpack-dev-middleware": "3.4.0",
53
54
  "webpack-log": "^2.0.0",
54
- "yargs": "12.0.1"
55
+ "yargs": "12.0.2"
55
56
  },
56
57
  "devDependencies": {
57
58
  "babel-cli": "^6.26.0",
@@ -74,6 +75,7 @@
74
75
  "mocha": "^5.2.0",
75
76
  "mocha-sinon": "^2.0.0",
76
77
  "nyc": "^12.0.2",
78
+ "rimraf": "^2.6.2",
77
79
  "should": "^13.2.0",
78
80
  "sinon": "^6.1.5",
79
81
  "standard-version": "^4.4.0",