webpack-dev-server 2.4.1 → 2.4.5
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/LICENSE +20 -20
- package/README.md +86 -88
- package/bin/webpack-dev-server.js +12 -1
- package/client/index.bundle.js +1 -3
- package/client/index.js +184 -173
- package/client/live.bundle.js +3 -6
- package/client/live.html +1 -1
- package/client/live.js +119 -119
- package/client/overlay.js +126 -126
- package/client/page.pug +7 -7
- package/client/socket.js +41 -41
- package/client/sockjs.bundle.js +1 -2
- package/client/sockjs.js +1 -1
- package/client/style.css +58 -58
- package/client/web_modules/jquery/index.js +1 -1
- package/client/web_modules/jquery/jquery-1.8.1.js +9301 -9301
- package/client/webpack.config.js +19 -19
- package/client/webpack.sockjs.config.js +6 -6
- package/lib/OptionsValidationError.js +159 -159
- package/lib/Server.js +551 -499
- package/lib/optionsSchema.json +293 -289
- package/lib/util/addDevServerEntrypoints.js +26 -24
- package/lib/util/createDomain.js +13 -13
- package/package.json +6 -4
- package/ssl/server.pem +46 -46
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
Copyright JS Foundation and other contributors
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
'Software'), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright JS Foundation and other contributors
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,88 +1,86 @@
|
|
|
1
|
-
# webpack-dev-server
|
|
2
|
-
|
|
3
|
-
[![npm][npm]][npm-url]
|
|
4
|
-
[![node][node]][node-url]
|
|
5
|
-
[![deps][deps]][deps-url]
|
|
6
|
-
[![tests][tests]][tests-url]
|
|
7
|
-
[![coverage][cover]][cover-url]
|
|
8
|
-
[![chat][chat]][chat-url]
|
|
9
|
-
|
|
10
|
-
<div align="center">
|
|
11
|
-
<a href="https://github.com/webpack/webpack">
|
|
12
|
-
<img width="200" height="200"
|
|
13
|
-
src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
14
|
-
</a>
|
|
15
|
-
<h1>webpack Dev Server</h1>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
Use [webpack](https://webpack.js.org) with a development server that provides live reloading. This should be used for **development only**.
|
|
19
|
-
|
|
20
|
-
It uses [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) under the hood, which provides fast in-memory access to the webpack assets.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
[
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
[
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[
|
|
86
|
-
|
|
87
|
-
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
88
|
-
[chat-url]: https://gitter.im/webpack/webpack
|
|
1
|
+
# webpack-dev-server
|
|
2
|
+
|
|
3
|
+
[![npm][npm]][npm-url]
|
|
4
|
+
[![node][node]][node-url]
|
|
5
|
+
[![deps][deps]][deps-url]
|
|
6
|
+
[![tests][tests]][tests-url]
|
|
7
|
+
[![coverage][cover]][cover-url]
|
|
8
|
+
[![chat][chat]][chat-url]
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
<a href="https://github.com/webpack/webpack">
|
|
12
|
+
<img width="200" height="200"
|
|
13
|
+
src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
14
|
+
</a>
|
|
15
|
+
<h1>webpack Dev Server</h1>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
Use [webpack](https://webpack.js.org) with a development server that provides live reloading. This should be used for **development only**.
|
|
19
|
+
|
|
20
|
+
It uses [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) under the hood, which provides fast in-memory access to the webpack assets.
|
|
21
|
+
|
|
22
|
+
<h2 align="center">Install</h2>
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm install webpack-dev-server --save-dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
<h2 align="center">Usage</h2>
|
|
29
|
+
|
|
30
|
+
The easiest way to use it is with the CLI. In the directory where your `webpack.config.js` is, run:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
node_modules/.bin/webpack-dev-server
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This will start a server, listening on connections from `localhost` on port `8080`.
|
|
37
|
+
|
|
38
|
+
Now, when you change something in your assets, it should live-reload the files.
|
|
39
|
+
|
|
40
|
+
See [**the documentation**](https://webpack.js.org/configuration/dev-server/#devserver) for more use cases and options.
|
|
41
|
+
|
|
42
|
+
<h2 align="center">Contributing</h2>
|
|
43
|
+
|
|
44
|
+
We appreciate all help! Check out [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to help.
|
|
45
|
+
|
|
46
|
+
<h2 align="center">Maintainers</h2>
|
|
47
|
+
|
|
48
|
+
<table>
|
|
49
|
+
<tbody>
|
|
50
|
+
<tr>
|
|
51
|
+
<td align="center">
|
|
52
|
+
<img width="150" height="150"
|
|
53
|
+
src="https://avatars.githubusercontent.com/SpaceK33z?v=3">
|
|
54
|
+
<br />
|
|
55
|
+
<a href="https://github.com/">Kees Kluskens</a>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</tbody>
|
|
59
|
+
</table>
|
|
60
|
+
|
|
61
|
+
<h2 align="center">Inspiration</h2>
|
|
62
|
+
|
|
63
|
+
This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).
|
|
64
|
+
|
|
65
|
+
<h2 align="center">LICENSE</h2>
|
|
66
|
+
|
|
67
|
+
#### [MIT](./LICENSE)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
[npm]: https://img.shields.io/npm/v/webpack-dev-server.svg
|
|
71
|
+
[npm-url]: https://npmjs.com/package/webpack-dev-server
|
|
72
|
+
|
|
73
|
+
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
|
|
74
|
+
[node-url]: https://nodejs.org
|
|
75
|
+
|
|
76
|
+
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
|
|
77
|
+
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
|
|
78
|
+
|
|
79
|
+
[tests]: http://img.shields.io/travis/webpack/webpack-dev-server.svg
|
|
80
|
+
[tests-url]: https://travis-ci.org/webpack/webpack-dev-server
|
|
81
|
+
|
|
82
|
+
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
|
|
83
|
+
[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
|
|
84
|
+
|
|
85
|
+
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
86
|
+
[chat-url]: https://gitter.im/webpack/webpack
|
|
@@ -247,7 +247,11 @@ function processOptions(wpOpt) {
|
|
|
247
247
|
if(options.contentBase === undefined) {
|
|
248
248
|
if(argv["content-base"]) {
|
|
249
249
|
options.contentBase = argv["content-base"];
|
|
250
|
-
if(
|
|
250
|
+
if(Array.isArray(options.contentBase)) {
|
|
251
|
+
options.contentBase = options.contentBase.map(function(val) {
|
|
252
|
+
return path.resolve(val);
|
|
253
|
+
});
|
|
254
|
+
} else if(/^[0-9]$/.test(options.contentBase))
|
|
251
255
|
options.contentBase = +options.contentBase;
|
|
252
256
|
else if(!/^(https?:)?\/\//.test(options.contentBase))
|
|
253
257
|
options.contentBase = path.resolve(options.contentBase);
|
|
@@ -361,6 +365,13 @@ function startDevServer(wpOpt, options) {
|
|
|
361
365
|
throw e;
|
|
362
366
|
}
|
|
363
367
|
|
|
368
|
+
["SIGINT", "SIGTERM"].forEach(function(sig) {
|
|
369
|
+
process.on(sig, function() {
|
|
370
|
+
server.close();
|
|
371
|
+
process.exit(); // eslint-disable-line no-process-exit
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
|
|
364
375
|
if(options.socket) {
|
|
365
376
|
server.listeningApp.on("error", function(e) {
|
|
366
377
|
if(e.code === "EADDRINUSE") {
|