webpack-dev-server 3.1.14 → 3.3.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 +45 -0
- package/README.md +14 -27
- package/bin/options.js +43 -31
- package/bin/webpack-dev-server.js +76 -249
- package/client/index.bundle.js +1 -1
- package/client/index.js +92 -42
- package/client/live.bundle.js +3 -3
- package/client/overlay.js +18 -21
- package/client/socket.js +4 -5
- package/client/sockjs.bundle.js +1 -1
- package/client/webpack.config.js +14 -0
- package/lib/Server.js +798 -683
- package/lib/options.json +40 -35
- package/lib/utils/addEntries.js +32 -11
- package/lib/utils/colors.js +22 -0
- package/lib/utils/createCertificate.js +14 -17
- package/lib/utils/createConfig.js +208 -0
- package/lib/utils/createDomain.js +7 -13
- package/lib/utils/createLogger.js +2 -5
- package/lib/utils/defaultTo.js +7 -0
- package/lib/utils/findPort.js +35 -0
- package/lib/utils/getVersions.js +12 -0
- package/lib/utils/runBonjour.js +21 -0
- package/lib/utils/status.js +62 -0
- package/lib/utils/tryParseInt.js +11 -0
- package/lib/utils/updateCompiler.js +67 -0
- package/package.json +72 -52
- package/bin/utils.js +0 -114
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,51 @@
|
|
|
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.3.1](https://github.com/webpack/webpack-dev-server/compare/v3.3.0...v3.3.1) (2019-04-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **regression:** always get necessary stats for hmr ([#1780](https://github.com/webpack/webpack-dev-server/issues/1780)) ([66b04a9](https://github.com/webpack/webpack-dev-server/commit/66b04a9))
|
|
11
|
+
* **regression:** host and port can be undefined or null ([#1779](https://github.com/webpack/webpack-dev-server/issues/1779)) ([028ceee](https://github.com/webpack/webpack-dev-server/commit/028ceee))
|
|
12
|
+
* only add entries after compilers have been created ([#1774](https://github.com/webpack/webpack-dev-server/issues/1774)) ([b31cbaa](https://github.com/webpack/webpack-dev-server/commit/b31cbaa))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# [3.3.0](https://github.com/webpack/webpack-dev-server/compare/v3.2.1...v3.3.0) (2019-04-08)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* compatibility with webpack-cli@3.3 ([#1754](https://github.com/webpack/webpack-dev-server/issues/1754)) ([fd7cb0d](https://github.com/webpack/webpack-dev-server/commit/fd7cb0d))
|
|
22
|
+
* ignore proxy when bypass return false ([#1696](https://github.com/webpack/webpack-dev-server/issues/1696)) ([aa7de77](https://github.com/webpack/webpack-dev-server/commit/aa7de77))
|
|
23
|
+
* respect stats option from webpack config ([#1665](https://github.com/webpack/webpack-dev-server/issues/1665)) ([efaa740](https://github.com/webpack/webpack-dev-server/commit/efaa740))
|
|
24
|
+
* use location.port when location.hostname is used to infer HMR socket URL ([#1664](https://github.com/webpack/webpack-dev-server/issues/1664)) ([2f7f052](https://github.com/webpack/webpack-dev-server/commit/2f7f052))
|
|
25
|
+
* don't crash with express.static.mime.types ([#1765](https://github.com/webpack/webpack-dev-server/issues/1765)) ([919ff77](https://github.com/webpack/webpack-dev-server/commit/919ff77))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add option "serveIndex" to enable/disable serveIndex middleware ([#1752](https://github.com/webpack/webpack-dev-server/issues/1752)) ([d5d60cb](https://github.com/webpack/webpack-dev-server/commit/d5d60cb))
|
|
31
|
+
* add webpack as argument to before and after options ([#1760](https://github.com/webpack/webpack-dev-server/issues/1760)) ([0984d4b](https://github.com/webpack/webpack-dev-server/commit/0984d4b))
|
|
32
|
+
* http2 option to enable/disable HTTP/2 with HTTPS ([#1721](https://github.com/webpack/webpack-dev-server/issues/1721)) ([dcd2434](https://github.com/webpack/webpack-dev-server/commit/dcd2434))
|
|
33
|
+
* random port retry logic ([#1692](https://github.com/webpack/webpack-dev-server/issues/1692)) ([419f02e](https://github.com/webpack/webpack-dev-server/commit/419f02e))
|
|
34
|
+
* relax depth limit from chokidar for content base ([#1697](https://github.com/webpack/webpack-dev-server/issues/1697)) ([7ea9ab9](https://github.com/webpack/webpack-dev-server/commit/7ea9ab9))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [3.2.1](https://github.com/webpack/webpack-dev-server/compare/v3.2.0...v3.2.1) (2019-02-25)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* deprecation message about `setup` now warning about `v4` ([#1684](https://github.com/webpack/webpack-dev-server/issues/1684)) ([523a6ec](https://github.com/webpack/webpack-dev-server/commit/523a6ec))
|
|
44
|
+
* **regression:** allow `ca`, `key` and `cert` will be string ([#1676](https://github.com/webpack/webpack-dev-server/issues/1676)) ([b8d5c1e](https://github.com/webpack/webpack-dev-server/commit/b8d5c1e))
|
|
45
|
+
* **regression:** handle `key`, `cert`, `cacert` and `pfx` in CLI ([#1688](https://github.com/webpack/webpack-dev-server/issues/1688)) ([4b2076c](https://github.com/webpack/webpack-dev-server/commit/4b2076c))
|
|
46
|
+
* **regression:** problem with `idb-connector` after update `internal-ip` ([#1691](https://github.com/webpack/webpack-dev-server/issues/1691)) ([eb48691](https://github.com/webpack/webpack-dev-server/commit/eb48691))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
5
50
|
<a name="3.1.14"></a>
|
|
6
51
|
## [3.1.14](https://github.com/webpack/webpack-dev-server/compare/v3.1.13...v3.1.14) (2018-12-24)
|
|
7
52
|
|
package/README.md
CHANGED
|
@@ -19,6 +19,17 @@ live reloading. This should be used for **development only**.
|
|
|
19
19
|
It uses [webpack-dev-middleware][middleware-url] under the hood, which provides
|
|
20
20
|
fast in-memory access to the webpack assets.
|
|
21
21
|
|
|
22
|
+
## Table of Contents
|
|
23
|
+
|
|
24
|
+
1. [Getting Started](#getting-started)
|
|
25
|
+
2. [Usage](#usage)
|
|
26
|
+
3. [Browser Support](#browser-support)
|
|
27
|
+
4. [Support](#support)
|
|
28
|
+
5. [Contributing](#contributing)
|
|
29
|
+
6. [Maintainers](#maintainers)
|
|
30
|
+
7. [Attribution](#attribution)
|
|
31
|
+
8. [License](#license)
|
|
32
|
+
|
|
22
33
|
## Getting Started
|
|
23
34
|
|
|
24
35
|
First things first, install the module:
|
|
@@ -44,6 +55,8 @@ The easiest way to use it is with the CLI. In the directory where your
|
|
|
44
55
|
node_modules/.bin/webpack-dev-server
|
|
45
56
|
```
|
|
46
57
|
|
|
58
|
+
_**Note**: Many CLI options are available with `webpack-dev-server`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._
|
|
59
|
+
|
|
47
60
|
### With NPM Scripts
|
|
48
61
|
|
|
49
62
|
NPM package.json scripts are a convenient and useful means to run locally installed
|
|
@@ -82,7 +95,7 @@ state, the project only officially supports the _last two versions of major
|
|
|
82
95
|
browsers_. We simply don't have the resources to support every whacky
|
|
83
96
|
browser out there.
|
|
84
97
|
|
|
85
|
-
If you find
|
|
98
|
+
If you find a bug with an obscure / old browser, we would actively welcome a
|
|
86
99
|
Pull Request to resolve the bug.
|
|
87
100
|
|
|
88
101
|
## Support
|
|
@@ -115,25 +128,6 @@ out completely._
|
|
|
115
128
|
|
|
116
129
|
We welcome your contributions! Please have a read of [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to get involved.
|
|
117
130
|
|
|
118
|
-
## Maintainers
|
|
119
|
-
|
|
120
|
-
<table>
|
|
121
|
-
<tbody>
|
|
122
|
-
<tr>
|
|
123
|
-
<td align="center">
|
|
124
|
-
<img src="https://avatars.githubusercontent.com/SpaceK33z?v=4&s=150">
|
|
125
|
-
<br />
|
|
126
|
-
<a href="https://github.com/SpaceK33z">Kees Kluskens</a>
|
|
127
|
-
</td>
|
|
128
|
-
<td align="center">
|
|
129
|
-
<img src="https://i.imgur.com/4v6pgxh.png">
|
|
130
|
-
<br />
|
|
131
|
-
<a href="https://github.com/shellscape">Andrew Powell</a>
|
|
132
|
-
</td>
|
|
133
|
-
</tr>
|
|
134
|
-
</tbody>
|
|
135
|
-
</table>
|
|
136
|
-
|
|
137
131
|
## Attribution
|
|
138
132
|
|
|
139
133
|
This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).
|
|
@@ -142,25 +136,18 @@ This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/
|
|
|
142
136
|
|
|
143
137
|
#### [MIT](./LICENSE)
|
|
144
138
|
|
|
145
|
-
|
|
146
139
|
[npm]: https://img.shields.io/npm/v/webpack-dev-server.svg
|
|
147
140
|
[npm-url]: https://npmjs.com/package/webpack-dev-server
|
|
148
|
-
|
|
149
141
|
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
|
|
150
142
|
[node-url]: https://nodejs.org
|
|
151
|
-
|
|
152
143
|
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
|
|
153
144
|
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
|
|
154
|
-
|
|
155
145
|
[tests]: http://img.shields.io/travis/webpack/webpack-dev-server.svg
|
|
156
146
|
[tests-url]: https://travis-ci.org/webpack/webpack-dev-server
|
|
157
|
-
|
|
158
147
|
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
|
|
159
148
|
[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
|
|
160
|
-
|
|
161
149
|
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
162
150
|
[chat-url]: https://gitter.im/webpack/webpack
|
|
163
|
-
|
|
164
151
|
[docs-url]: https://webpack.js.org/configuration/dev-server/#devserver
|
|
165
152
|
[hash-url]: https://twitter.com/search?q=webpack
|
|
166
153
|
[middleware-url]: https://github.com/webpack/webpack-dev-middleware
|
package/bin/options.js
CHANGED
|
@@ -15,43 +15,49 @@ const BASIC_GROUP = 'Basic options:';
|
|
|
15
15
|
const options = {
|
|
16
16
|
bonjour: {
|
|
17
17
|
type: 'boolean',
|
|
18
|
-
describe: 'Broadcasts the server via ZeroConf networking on start'
|
|
18
|
+
describe: 'Broadcasts the server via ZeroConf networking on start',
|
|
19
19
|
},
|
|
20
20
|
lazy: {
|
|
21
21
|
type: 'boolean',
|
|
22
|
-
describe: 'Lazy'
|
|
22
|
+
describe: 'Lazy',
|
|
23
|
+
},
|
|
24
|
+
serveIndex: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
describe: 'Enables/Disables serveIndex middleware',
|
|
27
|
+
default: true,
|
|
23
28
|
},
|
|
24
29
|
inline: {
|
|
25
30
|
type: 'boolean',
|
|
26
31
|
default: true,
|
|
27
|
-
describe:
|
|
32
|
+
describe:
|
|
33
|
+
'Inline mode (set to false to disable including client scripts like livereload)',
|
|
28
34
|
},
|
|
29
35
|
progress: {
|
|
30
36
|
type: 'boolean',
|
|
31
37
|
describe: 'Print compilation progress in percentage',
|
|
32
|
-
group: BASIC_GROUP
|
|
38
|
+
group: BASIC_GROUP,
|
|
33
39
|
},
|
|
34
40
|
'hot-only': {
|
|
35
41
|
type: 'boolean',
|
|
36
42
|
describe: 'Do not refresh page if HMR fails',
|
|
37
|
-
group: ADVANCED_GROUP
|
|
43
|
+
group: ADVANCED_GROUP,
|
|
38
44
|
},
|
|
39
45
|
stdin: {
|
|
40
46
|
type: 'boolean',
|
|
41
|
-
describe: 'close when stdin ends'
|
|
47
|
+
describe: 'close when stdin ends',
|
|
42
48
|
},
|
|
43
49
|
open: {
|
|
44
50
|
type: 'string',
|
|
45
|
-
describe: 'Open the default browser, or optionally specify a browser name'
|
|
51
|
+
describe: 'Open the default browser, or optionally specify a browser name',
|
|
46
52
|
},
|
|
47
53
|
useLocalIp: {
|
|
48
54
|
type: 'boolean',
|
|
49
|
-
describe: 'Open default browser with local IP'
|
|
55
|
+
describe: 'Open default browser with local IP',
|
|
50
56
|
},
|
|
51
57
|
'open-page': {
|
|
52
58
|
type: 'string',
|
|
53
59
|
describe: 'Open default browser with the specified page',
|
|
54
|
-
requiresArg: true
|
|
60
|
+
requiresArg: true,
|
|
55
61
|
},
|
|
56
62
|
color: {
|
|
57
63
|
type: 'boolean',
|
|
@@ -62,105 +68,111 @@ const options = {
|
|
|
62
68
|
return require('supports-color').stdout;
|
|
63
69
|
},
|
|
64
70
|
group: DISPLAY_GROUP,
|
|
65
|
-
describe: 'Enables/Disables colors on the console'
|
|
71
|
+
describe: 'Enables/Disables colors on the console',
|
|
66
72
|
},
|
|
67
73
|
info: {
|
|
68
74
|
type: 'boolean',
|
|
69
75
|
group: DISPLAY_GROUP,
|
|
70
76
|
default: true,
|
|
71
|
-
describe: 'Info'
|
|
77
|
+
describe: 'Info',
|
|
72
78
|
},
|
|
73
79
|
quiet: {
|
|
74
80
|
type: 'boolean',
|
|
75
81
|
group: DISPLAY_GROUP,
|
|
76
|
-
describe: 'Quiet'
|
|
82
|
+
describe: 'Quiet',
|
|
77
83
|
},
|
|
78
84
|
'client-log-level': {
|
|
79
85
|
type: 'string',
|
|
80
86
|
group: DISPLAY_GROUP,
|
|
81
87
|
default: 'info',
|
|
82
|
-
describe: 'Log level in the browser (info, warning, error or none)'
|
|
88
|
+
describe: 'Log level in the browser (info, warning, error or none)',
|
|
83
89
|
},
|
|
84
90
|
https: {
|
|
85
91
|
type: 'boolean',
|
|
86
92
|
group: SSL_GROUP,
|
|
87
|
-
describe: 'HTTPS'
|
|
93
|
+
describe: 'HTTPS',
|
|
94
|
+
},
|
|
95
|
+
http2: {
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
group: SSL_GROUP,
|
|
98
|
+
describe: 'HTTP/2, must be used with HTTPS',
|
|
88
99
|
},
|
|
89
100
|
key: {
|
|
90
101
|
type: 'string',
|
|
91
102
|
describe: 'Path to a SSL key.',
|
|
92
|
-
group: SSL_GROUP
|
|
103
|
+
group: SSL_GROUP,
|
|
93
104
|
},
|
|
94
105
|
cert: {
|
|
95
106
|
type: 'string',
|
|
96
107
|
describe: 'Path to a SSL certificate.',
|
|
97
|
-
group: SSL_GROUP
|
|
108
|
+
group: SSL_GROUP,
|
|
98
109
|
},
|
|
99
110
|
cacert: {
|
|
100
111
|
type: 'string',
|
|
101
112
|
describe: 'Path to a SSL CA certificate.',
|
|
102
|
-
group: SSL_GROUP
|
|
113
|
+
group: SSL_GROUP,
|
|
103
114
|
},
|
|
104
115
|
pfx: {
|
|
105
116
|
type: 'string',
|
|
106
117
|
describe: 'Path to a SSL pfx file.',
|
|
107
|
-
group: SSL_GROUP
|
|
118
|
+
group: SSL_GROUP,
|
|
108
119
|
},
|
|
109
120
|
'pfx-passphrase': {
|
|
110
121
|
type: 'string',
|
|
111
122
|
describe: 'Passphrase for pfx file.',
|
|
112
|
-
group: SSL_GROUP
|
|
123
|
+
group: SSL_GROUP,
|
|
113
124
|
},
|
|
114
125
|
'content-base': {
|
|
115
126
|
type: 'string',
|
|
116
127
|
describe: 'A directory or URL to serve HTML content from.',
|
|
117
|
-
group: RESPONSE_GROUP
|
|
128
|
+
group: RESPONSE_GROUP,
|
|
118
129
|
},
|
|
119
130
|
'watch-content-base': {
|
|
120
131
|
type: 'boolean',
|
|
121
132
|
describe: 'Enable live-reloading of the content-base.',
|
|
122
|
-
group: RESPONSE_GROUP
|
|
133
|
+
group: RESPONSE_GROUP,
|
|
123
134
|
},
|
|
124
135
|
'history-api-fallback': {
|
|
125
136
|
type: 'boolean',
|
|
126
137
|
describe: 'Fallback to /index.html for Single Page Applications.',
|
|
127
|
-
group: RESPONSE_GROUP
|
|
138
|
+
group: RESPONSE_GROUP,
|
|
128
139
|
},
|
|
129
140
|
compress: {
|
|
130
141
|
type: 'boolean',
|
|
131
142
|
describe: 'Enable gzip compression',
|
|
132
|
-
group: RESPONSE_GROUP
|
|
143
|
+
group: RESPONSE_GROUP,
|
|
133
144
|
},
|
|
134
145
|
port: {
|
|
135
146
|
describe: 'The port',
|
|
136
|
-
group: CONNECTION_GROUP
|
|
147
|
+
group: CONNECTION_GROUP,
|
|
137
148
|
},
|
|
138
149
|
'disable-host-check': {
|
|
139
150
|
type: 'boolean',
|
|
140
151
|
describe: 'Will not check the host',
|
|
141
|
-
group: CONNECTION_GROUP
|
|
152
|
+
group: CONNECTION_GROUP,
|
|
142
153
|
},
|
|
143
154
|
socket: {
|
|
144
155
|
type: 'String',
|
|
145
156
|
describe: 'Socket to listen',
|
|
146
|
-
group: CONNECTION_GROUP
|
|
157
|
+
group: CONNECTION_GROUP,
|
|
147
158
|
},
|
|
148
159
|
public: {
|
|
149
160
|
type: 'string',
|
|
150
161
|
describe: 'The public hostname/ip address of the server',
|
|
151
|
-
group: CONNECTION_GROUP
|
|
162
|
+
group: CONNECTION_GROUP,
|
|
152
163
|
},
|
|
153
164
|
host: {
|
|
154
165
|
type: 'string',
|
|
155
166
|
default: 'localhost',
|
|
156
167
|
describe: 'The hostname/ip address the server will bind to',
|
|
157
|
-
group: CONNECTION_GROUP
|
|
168
|
+
group: CONNECTION_GROUP,
|
|
158
169
|
},
|
|
159
170
|
'allowed-hosts': {
|
|
160
171
|
type: 'string',
|
|
161
|
-
describe:
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
describe:
|
|
173
|
+
'A comma-delimited string of hosts that are allowed to access the dev server',
|
|
174
|
+
group: CONNECTION_GROUP,
|
|
175
|
+
},
|
|
164
176
|
};
|
|
165
177
|
|
|
166
178
|
module.exports = options;
|