webpack-dev-server 3.8.2 → 3.9.0

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 CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.9.0](https://github.com/webpack/webpack-dev-server/compare/v3.8.2...v3.9.0) (2019-10-22)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add `hostname` and `port` to bonjour name to prevent name collisions ([#2276](https://github.com/webpack/webpack-dev-server/issues/2276)) ([d8af2d9](https://github.com/webpack/webpack-dev-server/commit/d8af2d9))
11
+ * add `extKeyUsage` to self-signed cert ([#2274](https://github.com/webpack/webpack-dev-server/issues/2274)) ([a4dbc3b](https://github.com/webpack/webpack-dev-server/commit/a4dbc3b))
12
+
13
+
14
+ ### Features
15
+
16
+ * add multiple `openPage` support ([#2266](https://github.com/webpack/webpack-dev-server/issues/2266)) ([c9e9178](https://github.com/webpack/webpack-dev-server/commit/c9e9178))
17
+
5
18
  ### [3.8.2](https://github.com/webpack/webpack-dev-server/compare/v3.8.1...v3.8.2) (2019-10-02)
6
19
 
7
20
  ### Security
@@ -0,0 +1,195 @@
1
+ '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
+ };
package/lib/options.json CHANGED
@@ -209,7 +209,18 @@
209
209
  ]
210
210
  },
211
211
  "openPage": {
212
- "type": "string"
212
+ "anyOf": [
213
+ {
214
+ "type": "string"
215
+ },
216
+ {
217
+ "type": "array",
218
+ "items": {
219
+ "type": "string"
220
+ },
221
+ "minItems": 1
222
+ }
223
+ ]
213
224
  },
214
225
  "overlay": {
215
226
  "anyOf": [
@@ -436,7 +447,7 @@
436
447
  "noInfo": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devservernoinfo-)",
437
448
  "onListening": "should be {Function} (https://webpack.js.org/configuration/dev-server/#onlistening)",
438
449
  "open": "should be {String|Boolean} (https://webpack.js.org/configuration/dev-server/#devserveropen)",
439
- "openPage": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserveropenpage)",
450
+ "openPage": "should be {String|Array} (https://webpack.js.org/configuration/dev-server/#devserveropenpage)",
440
451
  "overlay": "should be {Boolean|Object} (https://webpack.js.org/configuration/dev-server/#devserveroverlay)",
441
452
  "pfx": "should be {String|Buffer} (https://webpack.js.org/configuration/dev-server/#devserverpfx)",
442
453
  "pfxPassphrase": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserverpfxpassphrase)",
@@ -20,6 +20,13 @@ function createCertificate(attributes) {
20
20
  keyEncipherment: true,
21
21
  dataEncipherment: true,
22
22
  },
23
+ {
24
+ name: 'extKeyUsage',
25
+ serverAuth: true,
26
+ clientAuth: true,
27
+ codeSigning: true,
28
+ timeStamping: true,
29
+ },
23
30
  {
24
31
  name: 'subjectAltName',
25
32
  altNames: [
@@ -203,7 +203,7 @@ function createConfig(config, argv, { port }) {
203
203
 
204
204
  if (argv.openPage) {
205
205
  options.open = true;
206
- options.openPage = argv.openPage;
206
+ options.openPage = argv.openPage.split(',');
207
207
  }
208
208
 
209
209
  if (typeof argv.open !== 'undefined') {
@@ -2,9 +2,10 @@
2
2
 
3
3
  function runBonjour({ port }) {
4
4
  const bonjour = require('bonjour')();
5
+ const os = require('os');
5
6
 
6
7
  bonjour.publish({
7
- name: 'Webpack Dev Server',
8
+ name: `Webpack Dev Server ${os.hostname()}:${port}`,
8
9
  port,
9
10
  type: 'http',
10
11
  subtypes: ['webpack'],
@@ -6,23 +6,29 @@ const isAbsoluteUrl = require('is-absolute-url');
6
6
  function runOpen(uri, options, log) {
7
7
  // https://github.com/webpack/webpack-dev-server/issues/1990
8
8
  let openOptions = { wait: false };
9
- let openMessage = 'Unable to open browser';
9
+ let openOptionValue = '';
10
10
 
11
11
  if (typeof options.open === 'string') {
12
12
  openOptions = Object.assign({}, openOptions, { app: options.open });
13
- openMessage += `: ${options.open}`;
13
+ openOptionValue = `: "${options.open}"`;
14
14
  }
15
15
 
16
- const pageUrl =
17
- options.openPage && isAbsoluteUrl(options.openPage)
18
- ? options.openPage
19
- : `${uri}${options.openPage || ''}`;
16
+ const pages =
17
+ typeof options.openPage === 'string'
18
+ ? [options.openPage]
19
+ : options.openPage || [''];
20
20
 
21
- return open(pageUrl, openOptions).catch(() => {
22
- log.warn(
23
- `${openMessage}. If you are running in a headless environment, please do not use the --open flag`
24
- );
25
- });
21
+ return Promise.all(
22
+ pages.map((page) => {
23
+ const pageUrl = page && isAbsoluteUrl(page) ? page : `${uri}${page}`;
24
+
25
+ return open(pageUrl, openOptions).catch(() => {
26
+ log.warn(
27
+ `Unable to open "${pageUrl}" in browser${openOptionValue}. If you are running in a headless environment, please do not use the --open flag`
28
+ );
29
+ });
30
+ })
31
+ );
26
32
  }
27
33
 
28
34
  module.exports = runOpen;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-dev-server",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
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",
@@ -54,7 +54,7 @@
54
54
  "loglevel": "^1.6.4",
55
55
  "opn": "^5.5.0",
56
56
  "p-retry": "^3.0.1",
57
- "portfinder": "^1.0.24",
57
+ "portfinder": "^1.0.25",
58
58
  "schema-utils": "^1.0.0",
59
59
  "selfsigned": "^1.10.7",
60
60
  "semver": "^6.3.0",
@@ -71,33 +71,33 @@
71
71
  "yargs": "12.0.5"
72
72
  },
73
73
  "devDependencies": {
74
- "@babel/cli": "^7.6.2",
75
- "@babel/core": "^7.6.2",
74
+ "@babel/cli": "^7.6.4",
75
+ "@babel/core": "^7.6.4",
76
76
  "@babel/plugin-transform-runtime": "^7.6.2",
77
- "@babel/preset-env": "^7.6.2",
78
- "@babel/runtime": "^7.6.2",
79
- "@commitlint/cli": "^8.1.0",
80
- "@commitlint/config-conventional": "^8.1.0",
77
+ "@babel/preset-env": "^7.6.3",
78
+ "@babel/runtime": "^7.6.3",
79
+ "@commitlint/cli": "^8.2.0",
80
+ "@commitlint/config-conventional": "^8.2.0",
81
81
  "babel-loader": "^8.0.6",
82
82
  "body-parser": "^1.19.0",
83
83
  "commitlint-azure-pipelines-cli": "^1.0.2",
84
84
  "copy-webpack-plugin": "^5.0.4",
85
85
  "css-loader": "^2.1.1",
86
- "eslint": "^6.4.0",
87
- "eslint-config-prettier": "^6.3.0",
86
+ "eslint": "^6.5.1",
87
+ "eslint-config-prettier": "^6.4.0",
88
88
  "eslint-config-webpack": "^1.2.5",
89
89
  "eslint-plugin-import": "^2.18.2",
90
90
  "execa": "^1.0.0",
91
91
  "file-loader": "^3.0.1",
92
92
  "html-loader": "^0.5.5",
93
93
  "html-webpack-plugin": "^3.2.0",
94
- "husky": "^3.0.8",
94
+ "husky": "^3.0.9",
95
95
  "jest": "^24.9.0",
96
96
  "jest-junit": "^8.0.0",
97
97
  "jquery": "^3.4.1",
98
98
  "less": "^3.10.3",
99
99
  "less-loader": "^5.0.0",
100
- "lint-staged": "^9.2.5",
100
+ "lint-staged": "^9.4.2",
101
101
  "marked": "^0.7.0",
102
102
  "memfs": "^2.15.5",
103
103
  "npm-run-all": "^4.1.5",
@@ -108,9 +108,9 @@
108
108
  "style-loader": "^1.0.0",
109
109
  "supertest": "^4.0.2",
110
110
  "tcp-port-used": "^1.0.1",
111
- "typescript": "^3.6.3",
111
+ "typescript": "^3.6.4",
112
112
  "url-loader": "^1.1.2",
113
- "webpack": "^4.40.2",
113
+ "webpack": "^4.41.2",
114
114
  "webpack-cli": "^3.3.9"
115
115
  },
116
116
  "peerDependencies": {