webpack-dev-server 3.7.0 → 3.7.1
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 +9 -0
- package/lib/utils/createLogger.js +1 -1
- package/lib/utils/findPort.js +17 -6
- package/lib/utils/runOpen.js +1 -1
- package/lib/utils/tryParseInt.js +2 -0
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.7.1](https://github.com/webpack/webpack-dev-server/compare/v3.7.0...v3.7.1) (2019-06-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* retry finding port when port is null and get ports in sequence ([#1993](https://github.com/webpack/webpack-dev-server/issues/1993)) ([bc57514](https://github.com/webpack/webpack-dev-server/commit/bc57514))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [3.7.0](https://github.com/webpack/webpack-dev-server/compare/v3.5.1...v3.7.0) (2019-06-06)
|
|
6
15
|
|
|
7
16
|
|
package/lib/utils/findPort.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const pRetry = require('p-retry');
|
|
4
|
+
const portfinder = require('portfinder');
|
|
4
5
|
const defaultPort = require('./defaultPort');
|
|
5
6
|
const defaultTo = require('./defaultTo');
|
|
6
7
|
const tryParseInt = require('./tryParseInt');
|
|
7
8
|
|
|
9
|
+
function runPortFinder() {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
portfinder.basePort = defaultPort;
|
|
12
|
+
portfinder.getPort((error, port) => {
|
|
13
|
+
if (error) {
|
|
14
|
+
return reject(error);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return resolve(port);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
function findPort(port) {
|
|
9
|
-
if (
|
|
23
|
+
if (port) {
|
|
10
24
|
return Promise.resolve(port);
|
|
11
25
|
}
|
|
12
26
|
|
|
@@ -19,10 +33,7 @@ function findPort(port) {
|
|
|
19
33
|
3
|
|
20
34
|
);
|
|
21
35
|
|
|
22
|
-
return
|
|
23
|
-
port: defaultPort,
|
|
24
|
-
stopPort: defaultPort + defaultPortRetry,
|
|
25
|
-
});
|
|
36
|
+
return pRetry(runPortFinder, { retries: defaultPortRetry });
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
module.exports = findPort;
|
package/lib/utils/runOpen.js
CHANGED
|
@@ -11,7 +11,7 @@ function runOpen(uri, options, log) {
|
|
|
11
11
|
openMessage += `: ${options.open}`;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
open(`${uri}${options.openPage || ''}`, openOptions).catch(() => {
|
|
14
|
+
return open(`${uri}${options.openPage || ''}`, openOptions).catch(() => {
|
|
15
15
|
log.warn(
|
|
16
16
|
`${openMessage}. If you are running in a headless environment, please do not use the --open flag`
|
|
17
17
|
);
|
package/lib/utils/tryParseInt.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-server",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
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",
|
|
@@ -24,12 +24,13 @@
|
|
|
24
24
|
"test:watch": "npm run test:coverage --watch",
|
|
25
25
|
"test": "npm run test:coverage",
|
|
26
26
|
"pretest": "npm run lint",
|
|
27
|
-
"prepare": "rimraf ./ssl/*.pem && npm run
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"build:index": "webpack ./client-src/default/index.js -o client/index.bundle.js --color --config client-src/default/webpack.config.js",
|
|
31
|
-
"build:live": "webpack ./client-src/live/index.js -o client/live.bundle.js --color --config client-src/live/webpack.config.js",
|
|
32
|
-
"build:sockjs": "webpack ./client-src/sockjs/index.js -o client/sockjs.bundle.js --color --config client-src/sockjs/webpack.config.js",
|
|
27
|
+
"prepare": "rimraf ./ssl/*.pem && npm run build:client",
|
|
28
|
+
"build:client:default": "babel client-src/default --out-dir client --ignore \"./client-src/default/*.config.js\"",
|
|
29
|
+
"build:client:clients": "babel client-src/clients --out-dir client/clients",
|
|
30
|
+
"build:client:index": "webpack ./client-src/default/index.js -o client/index.bundle.js --color --config client-src/default/webpack.config.js",
|
|
31
|
+
"build:client:live": "webpack ./client-src/live/index.js -o client/live.bundle.js --color --config client-src/live/webpack.config.js",
|
|
32
|
+
"build:client:sockjs": "webpack ./client-src/sockjs/index.js -o client/sockjs.bundle.js --color --config client-src/sockjs/webpack.config.js",
|
|
33
|
+
"build:client": "rimraf ./client/* && npm-run-all -s -l -p \"build:client:**\"",
|
|
33
34
|
"webpack-dev-server": "cd $INIT_CWD && node ../../../bin/webpack-dev-server.js",
|
|
34
35
|
"release": "standard-version"
|
|
35
36
|
},
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"killable": "^1.0.1",
|
|
51
52
|
"loglevel": "^1.6.2",
|
|
52
53
|
"opn": "^5.5.0",
|
|
54
|
+
"p-retry": "^3.0.1",
|
|
53
55
|
"portfinder": "^1.0.20",
|
|
54
56
|
"schema-utils": "^1.0.0",
|
|
55
57
|
"selfsigned": "^1.10.4",
|
|
@@ -94,7 +96,7 @@
|
|
|
94
96
|
"marked": "^0.6.2",
|
|
95
97
|
"memfs": "^2.15.4",
|
|
96
98
|
"npm-run-all": "^4.1.5",
|
|
97
|
-
"prettier": "^1.
|
|
99
|
+
"prettier": "^1.18.0",
|
|
98
100
|
"puppeteer": "^1.17.0",
|
|
99
101
|
"rimraf": "^2.6.3",
|
|
100
102
|
"standard-version": "^6.0.1",
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
"supertest": "^4.0.2",
|
|
103
105
|
"url-loader": "^1.1.2",
|
|
104
106
|
"webpack": "^4.33.0",
|
|
105
|
-
"webpack-cli": "^3.3.
|
|
107
|
+
"webpack-cli": "^3.3.3",
|
|
106
108
|
"ws": "^6.2.1"
|
|
107
109
|
},
|
|
108
110
|
"peerDependencies": {
|