webpack-dev-server 2.4.2 → 2.5.0

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.
@@ -1,289 +1,312 @@
1
- {
2
- "additionalProperties": false,
3
- "properties": {
4
- "hot": {
5
- "description": "Enables Hot Module Replacement.",
6
- "type": "boolean"
7
- },
8
- "hotOnly": {
9
- "description": "Enables Hot Module Replacement without page refresh as fallback.",
10
- "type": "boolean"
11
- },
12
- "lazy": {
13
- "description": "Disables watch mode and recompiles bundle only on a request.",
14
- "type": "boolean"
15
- },
16
- "host": {
17
- "description": "The host the server listens to.",
18
- "type": "string"
19
- },
20
- "filename": {
21
- "description": "The filename that needs to be requested in order to trigger a recompile (only in lazy mode).",
22
- "anyOf": [
23
- {
24
- "instanceof": "RegExp"
25
- },
26
- {
27
- "type": "string"
28
- }
29
- ]
30
- },
31
- "publicPath": {
32
- "description": "URL path where the webpack files are served from.",
33
- "type": "string"
34
- },
35
- "port": {
36
- "description": "The port the server listens to.",
37
- "anyOf": [
38
- {
39
- "type": "number"
40
- },
41
- {
42
- "type": "string"
43
- }
44
- ]
45
- },
46
- "socket": {
47
- "description": "The Unix socket to listen to (instead of on a host).",
48
- "type": "string"
49
- },
50
- "watchOptions": {
51
- "description": "Options for changing the watch behavior.",
52
- "type": "object"
53
- },
54
- "headers": {
55
- "description": "Response headers that are added to each response.",
56
- "additionalProperties": {
57
- "type": "string"
58
- },
59
- "type": "object"
60
- },
61
- "clientLogLevel": {
62
- "description": "Controls the log messages shown in the browser.",
63
- "enum": [
64
- "none",
65
- "info",
66
- "warning",
67
- "error"
68
- ]
69
- },
70
- "overlay": {
71
- "description": "Shows an error overlay in browser.",
72
- "anyOf": [
73
- {
74
- "type": "boolean"
75
- },
76
- {
77
- "type": "object",
78
- "properties": {
79
- "errors": {
80
- "type": "boolean"
81
- },
82
- "warnings": {
83
- "type": "boolean"
84
- }
85
- }
86
- }
87
- ]
88
- },
89
- "key": {
90
- "description": "The contents of a SSL key.",
91
- "anyOf": [
92
- {
93
- "type": "string"
94
- },
95
- {
96
- "instanceof": "Buffer"
97
- }
98
- ]
99
- },
100
- "cert": {
101
- "description": "The contents of a SSL certificate.",
102
- "anyOf": [
103
- {
104
- "type": "string"
105
- },
106
- {
107
- "instanceof": "Buffer"
108
- }
109
- ]
110
- },
111
- "ca": {
112
- "description": "The contents of a SSL CA certificate.",
113
- "anyOf": [
114
- {
115
- "type": "string"
116
- },
117
- {
118
- "instanceof": "Buffer"
119
- }
120
- ]
121
- },
122
- "pfx": {
123
- "description": "The contents of a SSL pfx file.",
124
- "anyOf": [
125
- {
126
- "type": "string"
127
- },
128
- {
129
- "instanceof": "Buffer"
130
- }
131
- ]
132
- },
133
- "pfxPassphrase": {
134
- "description": "The passphrase to a (SSL) PFX file.",
135
- "type": "string"
136
- },
137
- "inline": {
138
- "description": "Enable inline mode to include client scripts in bundle (CLI-only).",
139
- "type": "boolean"
140
- },
141
- "public": {
142
- "description": "The public hostname/ip address of the server.",
143
- "type": "string"
144
- },
145
- "https": {
146
- "description": "Enable HTTPS for server.",
147
- "anyOf": [
148
- {
149
- "type": "object"
150
- },
151
- {
152
- "type": "boolean"
153
- }
154
- ]
155
- },
156
- "contentBase": {
157
- "description": "A directory to serve files non-webpack files from.",
158
- "anyOf": [
159
- {
160
- "items": {
161
- "type": "string"
162
- },
163
- "minItems": 1,
164
- "type": "array"
165
- },
166
- {
167
- "enum": [
168
- false
169
- ]
170
- },
171
- {
172
- "type": "number"
173
- },
174
- {
175
- "type": "string"
176
- }
177
- ]
178
- },
179
- "watchContentBase": {
180
- "description": "Watches the contentBase directory for changes.",
181
- "type": "boolean"
182
- },
183
- "open": {
184
- "description": "Let the CLI open your browser with the URL.",
185
- "type": "boolean"
186
- },
187
- "features": {
188
- "description": "The order of which the features will be triggered.",
189
- "items": {
190
- "type": "string"
191
- },
192
- "type": "array"
193
- },
194
- "compress": {
195
- "description": "Gzip compression for all requests.",
196
- "type": "boolean"
197
- },
198
- "proxy": {
199
- "description": "Proxy requests to another server.",
200
- "anyOf": [
201
- {
202
- "items": {
203
- "anyOf": [
204
- {
205
- "type": "object"
206
- },
207
- {
208
- "instanceof": "Function"
209
- }
210
- ]
211
- },
212
- "minItems": 1,
213
- "type": "array"
214
- },
215
- {
216
- "type": "object"
217
- }
218
- ]
219
- },
220
- "historyApiFallback": {
221
- "description": "404 fallback to a specified file.",
222
- "anyOf": [
223
- {
224
- "type": "boolean"
225
- },
226
- {
227
- "type": "object"
228
- }
229
- ]
230
- },
231
- "staticOptions": {
232
- "description": "Options for static files served with contentBase.",
233
- "type": "object"
234
- },
235
- "setup": {
236
- "description": "Exposes the Express server to add custom middleware or routes.",
237
- "instanceof": "Function"
238
- },
239
- "stats": {
240
- "description": "Decides what bundle information is displayed.",
241
- "anyOf": [
242
- {
243
- "type": "object"
244
- },
245
- {
246
- "type": "boolean"
247
- },
248
- {
249
- "enum": [
250
- "none",
251
- "errors-only",
252
- "minimal",
253
- "normal",
254
- "verbose"
255
- ]
256
- }
257
- ]
258
- },
259
- "reporter": {
260
- "description": "Customize what the console displays when compiling.",
261
- "instanceof": "Function"
262
- },
263
- "noInfo": {
264
- "description": "Hide all info messages on console.",
265
- "type": "boolean"
266
- },
267
- "quiet": {
268
- "description": "Hide all messages on console.",
269
- "type": "boolean"
270
- },
271
- "serverSideRender": {
272
- "description": "Expose stats for server side rendering (experimental).",
273
- "type": "boolean"
274
- },
275
- "index": {
276
- "description": "The filename that is considered the index file.",
277
- "type": "string"
278
- },
279
- "log": {
280
- "description": "Customize info logs for webpack-dev-middleware.",
281
- "instanceof": "Function"
282
- },
283
- "warn": {
284
- "description": "Customize warn logs for webpack-dev-middleware.",
285
- "instanceof": "Function"
286
- }
287
- },
288
- "type": "object"
289
- }
1
+ {
2
+ "additionalProperties": false,
3
+ "properties": {
4
+ "hot": {
5
+ "description": "Enables Hot Module Replacement.",
6
+ "type": "boolean"
7
+ },
8
+ "hotOnly": {
9
+ "description": "Enables Hot Module Replacement without page refresh as fallback.",
10
+ "type": "boolean"
11
+ },
12
+ "lazy": {
13
+ "description": "Disables watch mode and recompiles bundle only on a request.",
14
+ "type": "boolean"
15
+ },
16
+ "bonjour": {
17
+ "description": "Publishes the ZeroConf DNS service",
18
+ "type": "boolean"
19
+ },
20
+ "host": {
21
+ "description": "The host the server listens to.",
22
+ "type": "string"
23
+ },
24
+ "allowedHosts": {
25
+ "description": "Specifies which hosts are allowed to access the dev server.",
26
+ "items": {
27
+ "type": "string"
28
+ },
29
+ "type": "array"
30
+ },
31
+ "filename": {
32
+ "description": "The filename that needs to be requested in order to trigger a recompile (only in lazy mode).",
33
+ "anyOf": [
34
+ {
35
+ "instanceof": "RegExp"
36
+ },
37
+ {
38
+ "type": "string"
39
+ }
40
+ ]
41
+ },
42
+ "publicPath": {
43
+ "description": "URL path where the webpack files are served from.",
44
+ "type": "string"
45
+ },
46
+ "port": {
47
+ "description": "The port the server listens to.",
48
+ "anyOf": [
49
+ {
50
+ "type": "number"
51
+ },
52
+ {
53
+ "type": "string"
54
+ }
55
+ ]
56
+ },
57
+ "socket": {
58
+ "description": "The Unix socket to listen to (instead of on a host).",
59
+ "type": "string"
60
+ },
61
+ "watchOptions": {
62
+ "description": "Options for changing the watch behavior.",
63
+ "type": "object"
64
+ },
65
+ "headers": {
66
+ "description": "Response headers that are added to each response.",
67
+ "additionalProperties": {
68
+ "type": "string"
69
+ },
70
+ "type": "object"
71
+ },
72
+ "clientLogLevel": {
73
+ "description": "Controls the log messages shown in the browser.",
74
+ "enum": [
75
+ "none",
76
+ "info",
77
+ "warning",
78
+ "error"
79
+ ]
80
+ },
81
+ "overlay": {
82
+ "description": "Shows an error overlay in browser.",
83
+ "anyOf": [
84
+ {
85
+ "type": "boolean"
86
+ },
87
+ {
88
+ "type": "object",
89
+ "properties": {
90
+ "errors": {
91
+ "type": "boolean"
92
+ },
93
+ "warnings": {
94
+ "type": "boolean"
95
+ }
96
+ }
97
+ }
98
+ ]
99
+ },
100
+ "key": {
101
+ "description": "The contents of a SSL key.",
102
+ "anyOf": [
103
+ {
104
+ "type": "string"
105
+ },
106
+ {
107
+ "instanceof": "Buffer"
108
+ }
109
+ ]
110
+ },
111
+ "cert": {
112
+ "description": "The contents of a SSL certificate.",
113
+ "anyOf": [
114
+ {
115
+ "type": "string"
116
+ },
117
+ {
118
+ "instanceof": "Buffer"
119
+ }
120
+ ]
121
+ },
122
+ "ca": {
123
+ "description": "The contents of a SSL CA certificate.",
124
+ "anyOf": [
125
+ {
126
+ "type": "string"
127
+ },
128
+ {
129
+ "instanceof": "Buffer"
130
+ }
131
+ ]
132
+ },
133
+ "pfx": {
134
+ "description": "The contents of a SSL pfx file.",
135
+ "anyOf": [
136
+ {
137
+ "type": "string"
138
+ },
139
+ {
140
+ "instanceof": "Buffer"
141
+ }
142
+ ]
143
+ },
144
+ "pfxPassphrase": {
145
+ "description": "The passphrase to a (SSL) PFX file.",
146
+ "type": "string"
147
+ },
148
+ "inline": {
149
+ "description": "Enable inline mode to include client scripts in bundle (CLI-only).",
150
+ "type": "boolean"
151
+ },
152
+ "disableHostCheck": {
153
+ "description": "Disable the Host header check (Security).",
154
+ "type": "boolean"
155
+ },
156
+ "public": {
157
+ "description": "The public hostname/ip address of the server.",
158
+ "type": "string"
159
+ },
160
+ "https": {
161
+ "description": "Enable HTTPS for server.",
162
+ "anyOf": [
163
+ {
164
+ "type": "object"
165
+ },
166
+ {
167
+ "type": "boolean"
168
+ }
169
+ ]
170
+ },
171
+ "contentBase": {
172
+ "description": "A directory to serve files non-webpack files from.",
173
+ "anyOf": [
174
+ {
175
+ "items": {
176
+ "type": "string"
177
+ },
178
+ "minItems": 1,
179
+ "type": "array"
180
+ },
181
+ {
182
+ "enum": [
183
+ false
184
+ ]
185
+ },
186
+ {
187
+ "type": "number"
188
+ },
189
+ {
190
+ "type": "string"
191
+ }
192
+ ]
193
+ },
194
+ "watchContentBase": {
195
+ "description": "Watches the contentBase directory for changes.",
196
+ "type": "boolean"
197
+ },
198
+ "open": {
199
+ "description": "Let the CLI open your browser.",
200
+ "type": "boolean"
201
+ },
202
+ "useLocalIp": {
203
+ "description": "Let the browser open with your local IP.",
204
+ "type": "boolean"
205
+ },
206
+ "openPage": {
207
+ "description": "Let the CLI open your browser to a specific page on the site.",
208
+ "type": "string"
209
+ },
210
+ "features": {
211
+ "description": "The order of which the features will be triggered.",
212
+ "items": {
213
+ "type": "string"
214
+ },
215
+ "type": "array"
216
+ },
217
+ "compress": {
218
+ "description": "Gzip compression for all requests.",
219
+ "type": "boolean"
220
+ },
221
+ "proxy": {
222
+ "description": "Proxy requests to another server.",
223
+ "anyOf": [
224
+ {
225
+ "items": {
226
+ "anyOf": [
227
+ {
228
+ "type": "object"
229
+ },
230
+ {
231
+ "instanceof": "Function"
232
+ }
233
+ ]
234
+ },
235
+ "minItems": 1,
236
+ "type": "array"
237
+ },
238
+ {
239
+ "type": "object"
240
+ }
241
+ ]
242
+ },
243
+ "historyApiFallback": {
244
+ "description": "404 fallback to a specified file.",
245
+ "anyOf": [
246
+ {
247
+ "type": "boolean"
248
+ },
249
+ {
250
+ "type": "object"
251
+ }
252
+ ]
253
+ },
254
+ "staticOptions": {
255
+ "description": "Options for static files served with contentBase.",
256
+ "type": "object"
257
+ },
258
+ "setup": {
259
+ "description": "Exposes the Express server to add custom middleware or routes.",
260
+ "instanceof": "Function"
261
+ },
262
+ "stats": {
263
+ "description": "Decides what bundle information is displayed.",
264
+ "anyOf": [
265
+ {
266
+ "type": "object"
267
+ },
268
+ {
269
+ "type": "boolean"
270
+ },
271
+ {
272
+ "enum": [
273
+ "none",
274
+ "errors-only",
275
+ "minimal",
276
+ "normal",
277
+ "verbose"
278
+ ]
279
+ }
280
+ ]
281
+ },
282
+ "reporter": {
283
+ "description": "Customize what the console displays when compiling.",
284
+ "instanceof": "Function"
285
+ },
286
+ "noInfo": {
287
+ "description": "Hide all info messages on console.",
288
+ "type": "boolean"
289
+ },
290
+ "quiet": {
291
+ "description": "Hide all messages on console.",
292
+ "type": "boolean"
293
+ },
294
+ "serverSideRender": {
295
+ "description": "Expose stats for server side rendering (experimental).",
296
+ "type": "boolean"
297
+ },
298
+ "index": {
299
+ "description": "The filename that is considered the index file.",
300
+ "type": "string"
301
+ },
302
+ "log": {
303
+ "description": "Customize info logs for webpack-dev-middleware.",
304
+ "instanceof": "Function"
305
+ },
306
+ "warn": {
307
+ "description": "Customize warn logs for webpack-dev-middleware.",
308
+ "instanceof": "Function"
309
+ }
310
+ },
311
+ "type": "object"
312
+ }
@@ -1,26 +1,26 @@
1
- "use strict";
2
- const createDomain = require("./createDomain");
3
-
4
- module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions) {
5
- if(devServerOptions.inline !== false) {
6
- const domain = createDomain(devServerOptions);
7
- const devClient = [`${require.resolve("../../client/")}?${domain}`];
8
-
9
- if(devServerOptions.hotOnly)
10
- devClient.push("webpack/hot/only-dev-server");
11
- else if(devServerOptions.hot)
12
- devClient.push("webpack/hot/dev-server");
13
-
14
- [].concat(webpackOptions).forEach((wpOpt) => {
15
- if(typeof wpOpt.entry === "object" && !Array.isArray(wpOpt.entry)) {
16
- Object.keys(wpOpt.entry).forEach((key) => {
17
- wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]);
18
- });
19
- } else if(typeof wpOpt.entry === "function") {
20
- wpOpt.entry = wpOpt.entry(devClient);
21
- } else {
22
- wpOpt.entry = devClient.concat(wpOpt.entry);
23
- }
24
- });
25
- }
26
- };
1
+ "use strict";
2
+ const createDomain = require("./createDomain");
3
+
4
+ module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions) {
5
+ if(devServerOptions.inline !== false) {
6
+ const domain = createDomain(devServerOptions);
7
+ const devClient = [`${require.resolve("../../client/")}?${domain}`];
8
+
9
+ if(devServerOptions.hotOnly)
10
+ devClient.push("webpack/hot/only-dev-server");
11
+ else if(devServerOptions.hot)
12
+ devClient.push("webpack/hot/dev-server");
13
+
14
+ [].concat(webpackOptions).forEach((wpOpt) => {
15
+ if(typeof wpOpt.entry === "object" && !Array.isArray(wpOpt.entry)) {
16
+ Object.keys(wpOpt.entry).forEach((key) => {
17
+ wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]);
18
+ });
19
+ } else if(typeof wpOpt.entry === "function") {
20
+ wpOpt.entry = wpOpt.entry(devClient);
21
+ } else {
22
+ wpOpt.entry = devClient.concat(wpOpt.entry);
23
+ }
24
+ });
25
+ }
26
+ };