webpack-dev-server 2.11.0 → 2.11.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/LICENSE +20 -20
- package/README.md +178 -178
- package/bin/webpack-dev-server.js +0 -0
- package/client/index.bundle.js +1 -1
- package/client/live.bundle.js +2 -2
- package/client/live.html +1 -1
- package/lib/OptionsValidationError.js +152 -152
- package/lib/Server.js +706 -706
- package/lib/optionsSchema.json +336 -336
- package/lib/polyfills.js +8 -8
- package/lib/util/addDevServerEntrypoints.js +34 -34
- package/lib/util/createDomain.js +23 -23
- package/package.json +2 -2
- package/ssl/.DS_Store +0 -0
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,178 +1,178 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<a href="https://github.com/webpack/webpack">
|
|
3
|
-
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
4
|
-
</a>
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
[![npm][npm]][npm-url]
|
|
8
|
-
[![node][node]][node-url]
|
|
9
|
-
[![deps][deps]][deps-url]
|
|
10
|
-
[![tests][tests]][tests-url]
|
|
11
|
-
[![coverage][cover]][cover-url]
|
|
12
|
-
[![chat][chat]][chat-url]
|
|
13
|
-
|
|
14
|
-
# webpack-dev-server
|
|
15
|
-
|
|
16
|
-
Use [webpack](https://webpack.js.org) with a development server that provides
|
|
17
|
-
live reloading. This should be used for **development only**.
|
|
18
|
-
|
|
19
|
-
It uses [webpack-dev-middleware][middleware-url] under the hood, which provides
|
|
20
|
-
fast in-memory access to the webpack assets.
|
|
21
|
-
|
|
22
|
-
## Project in Maintenance
|
|
23
|
-
|
|
24
|
-
**Please note that `webpack-dev-server` is presently in a maintenance-only mode**
|
|
25
|
-
and will not be accepting any additional features in the near term. Most new feature
|
|
26
|
-
requests can be accomplished with Express middleware; please look into using
|
|
27
|
-
the [`before`](https://webpack.js.org/configuration/dev-server/#devserver-before)
|
|
28
|
-
and [`after`](https://webpack.js.org/configuration/dev-server/#devserver-after)
|
|
29
|
-
hooks in the documentation.
|
|
30
|
-
|
|
31
|
-
## Getting Started
|
|
32
|
-
|
|
33
|
-
First thing's first, install the module:
|
|
34
|
-
|
|
35
|
-
```console
|
|
36
|
-
npm install webpack-dev-server --save-dev
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
_Note: While you can install and run webpack-dev-server globally, we recommend
|
|
40
|
-
installing it locally. webpack-dev-server will always use a local installation
|
|
41
|
-
over a global one._
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
There are two main, recommended methods of using the module:
|
|
46
|
-
|
|
47
|
-
### With the CLI
|
|
48
|
-
|
|
49
|
-
The easiest way to use it is with the CLI. In the directory where your
|
|
50
|
-
`webpack.config.js` is, run:
|
|
51
|
-
|
|
52
|
-
```console
|
|
53
|
-
node_modules/.bin/webpack-dev-server
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### With NPM Scripts
|
|
57
|
-
|
|
58
|
-
NPM package.json scripts are a convenient and useful means to run locally installed
|
|
59
|
-
binaries without having to be concerned about their full paths. Simply define a
|
|
60
|
-
script as such:
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
"scripts": {
|
|
64
|
-
"start:dev": "webpack-dev-server"
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
And run the following in your terminal/console:
|
|
69
|
-
|
|
70
|
-
```console
|
|
71
|
-
npm run start:dev
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
NPM will automagically reference the binary in `node_modules` for you, and
|
|
75
|
-
execute the file or command.
|
|
76
|
-
|
|
77
|
-
### The Result
|
|
78
|
-
|
|
79
|
-
Either method will start a server instance and begin listening for connections
|
|
80
|
-
from `localhost` on port `8080`.
|
|
81
|
-
|
|
82
|
-
webpack-dev-server is configured by default to support live-reload of files as
|
|
83
|
-
you edit your assets while the server is running.
|
|
84
|
-
|
|
85
|
-
See [**the documentation**][docs-url] for more use cases and options.
|
|
86
|
-
|
|
87
|
-
## Browser Support
|
|
88
|
-
|
|
89
|
-
While `webpack-dev-server` transpiles the client (browser) scripts to an ES5
|
|
90
|
-
state, the project only officially supports the _last two versions of major
|
|
91
|
-
browsers_. We simply don't have the resources to support every whacky
|
|
92
|
-
browser out there.
|
|
93
|
-
|
|
94
|
-
If you find an bug with an obscure / old browser, we would actively welcome a
|
|
95
|
-
Pull Request to resolve the bug.
|
|
96
|
-
|
|
97
|
-
## Support
|
|
98
|
-
|
|
99
|
-
We do our best to keep Issues in the repository focused on bugs, features, and
|
|
100
|
-
needed modifications to the code for the module. Because of that, we ask users
|
|
101
|
-
with general support, "how-to", or "why isn't this working" questions to try one
|
|
102
|
-
of the other support channels that are available.
|
|
103
|
-
|
|
104
|
-
Your first-stop-shop for support for webpack-dev-server should by the excellent
|
|
105
|
-
[documentation][docs-url] for the module. If you see an opportunity for improvement
|
|
106
|
-
of those docs, please head over to the [webpack.js.org repo][wjo-url] and open a
|
|
107
|
-
pull request.
|
|
108
|
-
|
|
109
|
-
From there, we encourage users to visit the [webpack Gitter chat][chat-url] and
|
|
110
|
-
talk to the fine folks there. If your quest for answers comes up dry in chat,
|
|
111
|
-
head over to [StackOverflow][stack-url] and do a quick search or open a new
|
|
112
|
-
question. Remember; It's always much easier to answer questions that include your
|
|
113
|
-
`webpack.config.js` and relevant files!
|
|
114
|
-
|
|
115
|
-
If you're twitter-savvy you can tweet [#webpack][hash-url] with your question
|
|
116
|
-
and someone should be able to reach out and lend a hand.
|
|
117
|
-
|
|
118
|
-
If you have discovered a :bug:, have a feature suggestion, of would like to see
|
|
119
|
-
a modification, please feel free to create an issue on Github. _Note: The issue
|
|
120
|
-
template isn't optional, so please be sure not to remove it, and please fill it
|
|
121
|
-
out completely._
|
|
122
|
-
|
|
123
|
-
## Contributing
|
|
124
|
-
|
|
125
|
-
We welcome your contributions! Please have a read of [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to get involved.
|
|
126
|
-
|
|
127
|
-
## Maintainers
|
|
128
|
-
|
|
129
|
-
<table>
|
|
130
|
-
<tbody>
|
|
131
|
-
<tr>
|
|
132
|
-
<td align="center">
|
|
133
|
-
<img src="https://avatars.githubusercontent.com/SpaceK33z?v=4&s=150">
|
|
134
|
-
<br />
|
|
135
|
-
<a href="https://github.com/SpaceK33z">Kees Kluskens</a>
|
|
136
|
-
</td>
|
|
137
|
-
<td align="center">
|
|
138
|
-
<img src="https://i.imgur.com/4v6pgxh.png">
|
|
139
|
-
<br />
|
|
140
|
-
<a href="https://github.com/shellscape">Andrew Powell</a>
|
|
141
|
-
</td>
|
|
142
|
-
</tr>
|
|
143
|
-
</tbody>
|
|
144
|
-
</table>
|
|
145
|
-
|
|
146
|
-
## Attribution
|
|
147
|
-
|
|
148
|
-
This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).
|
|
149
|
-
|
|
150
|
-
## License
|
|
151
|
-
|
|
152
|
-
#### [MIT](./LICENSE)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
[npm]: https://img.shields.io/npm/v/webpack-dev-server.svg
|
|
156
|
-
[npm-url]: https://npmjs.com/package/webpack-dev-server
|
|
157
|
-
|
|
158
|
-
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
|
|
159
|
-
[node-url]: https://nodejs.org
|
|
160
|
-
|
|
161
|
-
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
|
|
162
|
-
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
|
|
163
|
-
|
|
164
|
-
[tests]: http://img.shields.io/travis/webpack/webpack-dev-server.svg
|
|
165
|
-
[tests-url]: https://travis-ci.org/webpack/webpack-dev-server
|
|
166
|
-
|
|
167
|
-
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
|
|
168
|
-
[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
|
|
169
|
-
|
|
170
|
-
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
171
|
-
[chat-url]: https://gitter.im/webpack/webpack
|
|
172
|
-
|
|
173
|
-
[docs-url]: https://webpack.js.org/configuration/dev-server/#devserver
|
|
174
|
-
[hash-url]: https://twitter.com/search?q=webpack
|
|
175
|
-
[middleware-url]: https://github.com/webpack/webpack-dev-middleware
|
|
176
|
-
[stack-url]: https://stackoverflow.com/questions/tagged/webpack-dev-server
|
|
177
|
-
[uglify-url]: https://github.com/webpack-contrib/uglifyjs-webpack-plugin
|
|
178
|
-
[wjo-url]: https://github.com/webpack/webpack.js.org
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://github.com/webpack/webpack">
|
|
3
|
+
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
4
|
+
</a>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
[![npm][npm]][npm-url]
|
|
8
|
+
[![node][node]][node-url]
|
|
9
|
+
[![deps][deps]][deps-url]
|
|
10
|
+
[![tests][tests]][tests-url]
|
|
11
|
+
[![coverage][cover]][cover-url]
|
|
12
|
+
[![chat][chat]][chat-url]
|
|
13
|
+
|
|
14
|
+
# webpack-dev-server
|
|
15
|
+
|
|
16
|
+
Use [webpack](https://webpack.js.org) with a development server that provides
|
|
17
|
+
live reloading. This should be used for **development only**.
|
|
18
|
+
|
|
19
|
+
It uses [webpack-dev-middleware][middleware-url] under the hood, which provides
|
|
20
|
+
fast in-memory access to the webpack assets.
|
|
21
|
+
|
|
22
|
+
## Project in Maintenance
|
|
23
|
+
|
|
24
|
+
**Please note that `webpack-dev-server` is presently in a maintenance-only mode**
|
|
25
|
+
and will not be accepting any additional features in the near term. Most new feature
|
|
26
|
+
requests can be accomplished with Express middleware; please look into using
|
|
27
|
+
the [`before`](https://webpack.js.org/configuration/dev-server/#devserver-before)
|
|
28
|
+
and [`after`](https://webpack.js.org/configuration/dev-server/#devserver-after)
|
|
29
|
+
hooks in the documentation.
|
|
30
|
+
|
|
31
|
+
## Getting Started
|
|
32
|
+
|
|
33
|
+
First thing's first, install the module:
|
|
34
|
+
|
|
35
|
+
```console
|
|
36
|
+
npm install webpack-dev-server --save-dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
_Note: While you can install and run webpack-dev-server globally, we recommend
|
|
40
|
+
installing it locally. webpack-dev-server will always use a local installation
|
|
41
|
+
over a global one._
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
There are two main, recommended methods of using the module:
|
|
46
|
+
|
|
47
|
+
### With the CLI
|
|
48
|
+
|
|
49
|
+
The easiest way to use it is with the CLI. In the directory where your
|
|
50
|
+
`webpack.config.js` is, run:
|
|
51
|
+
|
|
52
|
+
```console
|
|
53
|
+
node_modules/.bin/webpack-dev-server
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### With NPM Scripts
|
|
57
|
+
|
|
58
|
+
NPM package.json scripts are a convenient and useful means to run locally installed
|
|
59
|
+
binaries without having to be concerned about their full paths. Simply define a
|
|
60
|
+
script as such:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
"scripts": {
|
|
64
|
+
"start:dev": "webpack-dev-server"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
And run the following in your terminal/console:
|
|
69
|
+
|
|
70
|
+
```console
|
|
71
|
+
npm run start:dev
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
NPM will automagically reference the binary in `node_modules` for you, and
|
|
75
|
+
execute the file or command.
|
|
76
|
+
|
|
77
|
+
### The Result
|
|
78
|
+
|
|
79
|
+
Either method will start a server instance and begin listening for connections
|
|
80
|
+
from `localhost` on port `8080`.
|
|
81
|
+
|
|
82
|
+
webpack-dev-server is configured by default to support live-reload of files as
|
|
83
|
+
you edit your assets while the server is running.
|
|
84
|
+
|
|
85
|
+
See [**the documentation**][docs-url] for more use cases and options.
|
|
86
|
+
|
|
87
|
+
## Browser Support
|
|
88
|
+
|
|
89
|
+
While `webpack-dev-server` transpiles the client (browser) scripts to an ES5
|
|
90
|
+
state, the project only officially supports the _last two versions of major
|
|
91
|
+
browsers_. We simply don't have the resources to support every whacky
|
|
92
|
+
browser out there.
|
|
93
|
+
|
|
94
|
+
If you find an bug with an obscure / old browser, we would actively welcome a
|
|
95
|
+
Pull Request to resolve the bug.
|
|
96
|
+
|
|
97
|
+
## Support
|
|
98
|
+
|
|
99
|
+
We do our best to keep Issues in the repository focused on bugs, features, and
|
|
100
|
+
needed modifications to the code for the module. Because of that, we ask users
|
|
101
|
+
with general support, "how-to", or "why isn't this working" questions to try one
|
|
102
|
+
of the other support channels that are available.
|
|
103
|
+
|
|
104
|
+
Your first-stop-shop for support for webpack-dev-server should by the excellent
|
|
105
|
+
[documentation][docs-url] for the module. If you see an opportunity for improvement
|
|
106
|
+
of those docs, please head over to the [webpack.js.org repo][wjo-url] and open a
|
|
107
|
+
pull request.
|
|
108
|
+
|
|
109
|
+
From there, we encourage users to visit the [webpack Gitter chat][chat-url] and
|
|
110
|
+
talk to the fine folks there. If your quest for answers comes up dry in chat,
|
|
111
|
+
head over to [StackOverflow][stack-url] and do a quick search or open a new
|
|
112
|
+
question. Remember; It's always much easier to answer questions that include your
|
|
113
|
+
`webpack.config.js` and relevant files!
|
|
114
|
+
|
|
115
|
+
If you're twitter-savvy you can tweet [#webpack][hash-url] with your question
|
|
116
|
+
and someone should be able to reach out and lend a hand.
|
|
117
|
+
|
|
118
|
+
If you have discovered a :bug:, have a feature suggestion, of would like to see
|
|
119
|
+
a modification, please feel free to create an issue on Github. _Note: The issue
|
|
120
|
+
template isn't optional, so please be sure not to remove it, and please fill it
|
|
121
|
+
out completely._
|
|
122
|
+
|
|
123
|
+
## Contributing
|
|
124
|
+
|
|
125
|
+
We welcome your contributions! Please have a read of [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to get involved.
|
|
126
|
+
|
|
127
|
+
## Maintainers
|
|
128
|
+
|
|
129
|
+
<table>
|
|
130
|
+
<tbody>
|
|
131
|
+
<tr>
|
|
132
|
+
<td align="center">
|
|
133
|
+
<img src="https://avatars.githubusercontent.com/SpaceK33z?v=4&s=150">
|
|
134
|
+
<br />
|
|
135
|
+
<a href="https://github.com/SpaceK33z">Kees Kluskens</a>
|
|
136
|
+
</td>
|
|
137
|
+
<td align="center">
|
|
138
|
+
<img src="https://i.imgur.com/4v6pgxh.png">
|
|
139
|
+
<br />
|
|
140
|
+
<a href="https://github.com/shellscape">Andrew Powell</a>
|
|
141
|
+
</td>
|
|
142
|
+
</tr>
|
|
143
|
+
</tbody>
|
|
144
|
+
</table>
|
|
145
|
+
|
|
146
|
+
## Attribution
|
|
147
|
+
|
|
148
|
+
This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
#### [MIT](./LICENSE)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
[npm]: https://img.shields.io/npm/v/webpack-dev-server.svg
|
|
156
|
+
[npm-url]: https://npmjs.com/package/webpack-dev-server
|
|
157
|
+
|
|
158
|
+
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
|
|
159
|
+
[node-url]: https://nodejs.org
|
|
160
|
+
|
|
161
|
+
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
|
|
162
|
+
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
|
|
163
|
+
|
|
164
|
+
[tests]: http://img.shields.io/travis/webpack/webpack-dev-server.svg
|
|
165
|
+
[tests-url]: https://travis-ci.org/webpack/webpack-dev-server
|
|
166
|
+
|
|
167
|
+
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg
|
|
168
|
+
[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server
|
|
169
|
+
|
|
170
|
+
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
|
171
|
+
[chat-url]: https://gitter.im/webpack/webpack
|
|
172
|
+
|
|
173
|
+
[docs-url]: https://webpack.js.org/configuration/dev-server/#devserver
|
|
174
|
+
[hash-url]: https://twitter.com/search?q=webpack
|
|
175
|
+
[middleware-url]: https://github.com/webpack/webpack-dev-middleware
|
|
176
|
+
[stack-url]: https://stackoverflow.com/questions/tagged/webpack-dev-server
|
|
177
|
+
[uglify-url]: https://github.com/webpack-contrib/uglifyjs-webpack-plugin
|
|
178
|
+
[wjo-url]: https://github.com/webpack/webpack.js.org
|
|
File without changes
|