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 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
- **Note: There are known issues with Node.js v7 and webpack / webpack-dev-server. Please use Node.js v6 for the moment.**
23
-
24
- <h2 align="center">Install</h2>
25
-
26
- ```
27
- npm install webpack-dev-server --save-dev
28
- ```
29
-
30
- <h2 align="center">Usage</h2>
31
-
32
- The easiest way to use it is with the CLI. In the directory where your `webpack.config.js` is, run:
33
-
34
- ```
35
- node_modules/.bin/webpack-dev-server
36
- ```
37
-
38
- This will start a server, listening on connections from `localhost` on port `8080`.
39
-
40
- Now, when you change something in your assets, it should live-reload the files.
41
-
42
- See [**the documentation**](https://webpack.js.org/configuration/dev-server/#devserver) for more use cases and options.
43
-
44
- <h2 align="center">Contributing</h2>
45
-
46
- We appreciate all help! Check out [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to help.
47
-
48
- <h2 align="center">Maintainers</h2>
49
-
50
- <table>
51
- <tbody>
52
- <tr>
53
- <td align="center">
54
- <img width="150" height="150"
55
- src="https://avatars.githubusercontent.com/SpaceK33z?v=3">
56
- <br />
57
- <a href="https://github.com/">Kees Kluskens</a>
58
- </td>
59
- </tr>
60
- </tbody>
61
- </table>
62
-
63
- <h2 align="center">Inspiration</h2>
64
-
65
- This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).
66
-
67
- <h2 align="center">LICENSE</h2>
68
-
69
- #### [MIT](./LICENSE)
70
-
71
-
72
- [npm]: https://img.shields.io/npm/v/webpack-dev-server.svg
73
- [npm-url]: https://npmjs.com/package/webpack-dev-server
74
-
75
- [node]: https://img.shields.io/node/v/webpack-dev-server.svg
76
- [node-url]: https://nodejs.org
77
-
78
- [deps]: https://david-dm.org/webpack/webpack-dev-server.svg
79
- [deps-url]: https://david-dm.org/webpack/webpack-dev-server
80
-
81
- [tests]: http://img.shields.io/travis/webpack/webpack-dev-server.svg
82
- [tests-url]: https://travis-ci.org/webpack/webpack-dev-server
83
-
84
- [cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
85
- [cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
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(/^[0-9]$/.test(options.contentBase))
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") {