webpack-dev-server 4.7.0 → 4.7.4
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/bin/cli-flags.js +26 -22
- package/client/clients/SockJSClient.js +5 -1
- package/client/index.js +50 -2
- package/client/modules/sockjs-client/index.js +15 -4
- package/client/overlay.js +38 -3
- package/client/socket.js +14 -2
- package/client/utils/createSocketURL.js +71 -4
- package/client/utils/getCurrentScriptSource.js +3 -0
- package/client/utils/parseURL.js +17 -19
- package/client/utils/reloadApp.js +15 -2
- package/client/utils/sendMessage.js +1 -1
- package/lib/Server.js +129 -138
- package/lib/options.json +59 -12
- package/package.json +16 -15
- package/types/bin/cli-flags.d.ts +29 -21
- package/types/lib/Server.d.ts +503 -303
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
/* global __webpack_hash__ */
|
|
2
1
|
import hotEmitter from "webpack/hot/emitter.js";
|
|
3
2
|
import { log } from "./log.js";
|
|
3
|
+
/** @typedef {import("../index").Options} Options
|
|
4
|
+
/** @typedef {import("../index").Status} Status
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {Options} options
|
|
8
|
+
* @param {Status} status
|
|
9
|
+
*/
|
|
4
10
|
|
|
5
11
|
function reloadApp(_ref, status) {
|
|
6
12
|
var hot = _ref.hot,
|
|
@@ -12,11 +18,18 @@ function reloadApp(_ref, status) {
|
|
|
12
18
|
|
|
13
19
|
var currentHash = status.currentHash,
|
|
14
20
|
previousHash = status.previousHash;
|
|
15
|
-
var isInitial = currentHash.indexOf(
|
|
21
|
+
var isInitial = currentHash.indexOf(
|
|
22
|
+
/** @type {string} */
|
|
23
|
+
previousHash) >= 0;
|
|
16
24
|
|
|
17
25
|
if (isInitial) {
|
|
18
26
|
return;
|
|
19
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @param {Window} rootWindow
|
|
30
|
+
* @param {number} intervalId
|
|
31
|
+
*/
|
|
32
|
+
|
|
20
33
|
|
|
21
34
|
function applyReload(rootWindow, intervalId) {
|
|
22
35
|
clearInterval(intervalId);
|
package/lib/Server.js
CHANGED
|
@@ -25,6 +25,7 @@ const schema = require("./options.json");
|
|
|
25
25
|
/** @typedef {import("express").NextFunction} NextFunction */
|
|
26
26
|
/** @typedef {import("express").RequestHandler} ExpressRequestHandler */
|
|
27
27
|
/** @typedef {import("express").ErrorRequestHandler} ExpressErrorRequestHandler */
|
|
28
|
+
/** @typedef {import("anymatch").Matcher} AnymatchMatcher */
|
|
28
29
|
/** @typedef {import("chokidar").WatchOptions} WatchOptions */
|
|
29
30
|
/** @typedef {import("chokidar").FSWatcher} FSWatcher */
|
|
30
31
|
/** @typedef {import("connect-history-api-fallback").Options} ConnectHistoryApiFallbackOptions */
|
|
@@ -64,7 +65,7 @@ const schema = require("./options.json");
|
|
|
64
65
|
/**
|
|
65
66
|
* @typedef {Object} WatchFiles
|
|
66
67
|
* @property {string | string[]} paths
|
|
67
|
-
* @property {WatchOptions & { aggregateTimeout?: number, ignored?:
|
|
68
|
+
* @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options]
|
|
68
69
|
*/
|
|
69
70
|
|
|
70
71
|
/**
|
|
@@ -73,7 +74,7 @@ const schema = require("./options.json");
|
|
|
73
74
|
* @property {string | string[]} [publicPath]
|
|
74
75
|
* @property {boolean | ServeIndexOptions} [serveIndex]
|
|
75
76
|
* @property {ServeStaticOptions} [staticOptions]
|
|
76
|
-
* @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?:
|
|
77
|
+
* @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch]
|
|
77
78
|
*/
|
|
78
79
|
|
|
79
80
|
/**
|
|
@@ -110,22 +111,22 @@ const schema = require("./options.json");
|
|
|
110
111
|
*/
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
|
-
* @
|
|
114
|
+
* @callback ByPass
|
|
115
|
+
* @param {Request} req
|
|
116
|
+
* @param {Response} res
|
|
117
|
+
* @param {ProxyConfigArrayItem} proxyConfig
|
|
114
118
|
*/
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
|
-
* @typedef {HttpProxyMiddlewareOptions
|
|
121
|
+
* @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem
|
|
118
122
|
*/
|
|
119
123
|
|
|
120
124
|
/**
|
|
121
|
-
* @
|
|
122
|
-
* @param {Request} req
|
|
123
|
-
* @param {Response} res
|
|
124
|
-
* @param {ProxyConfigArray} proxyConfig
|
|
125
|
+
* @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray
|
|
125
126
|
*/
|
|
126
127
|
|
|
127
128
|
/**
|
|
128
|
-
* @typedef {{
|
|
129
|
+
* @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap
|
|
129
130
|
*/
|
|
130
131
|
|
|
131
132
|
/**
|
|
@@ -194,7 +195,7 @@ const schema = require("./options.json");
|
|
|
194
195
|
* @property {boolean} [http2]
|
|
195
196
|
* @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
|
|
196
197
|
* @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
|
|
197
|
-
* @property {ProxyConfigMap |
|
|
198
|
+
* @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
|
|
198
199
|
* @property {boolean | string | Open | Array<string | Open>} [open]
|
|
199
200
|
* @property {boolean} [setupExitSignals]
|
|
200
201
|
* @property {boolean | ClientConfiguration} [client]
|
|
@@ -754,7 +755,7 @@ class Server {
|
|
|
754
755
|
// TODO remove `{}` after drop webpack v4 support
|
|
755
756
|
const compilerWatchOptions = compilerOptions.watchOptions || {};
|
|
756
757
|
/**
|
|
757
|
-
* @param {WatchOptions &
|
|
758
|
+
* @param {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} watchOptions
|
|
758
759
|
* @returns {WatchOptions}
|
|
759
760
|
*/
|
|
760
761
|
const getWatchOptions = (watchOptions = {}) => {
|
|
@@ -1380,10 +1381,10 @@ class Server {
|
|
|
1380
1381
|
Object.prototype.hasOwnProperty.call(options.proxy, "target") ||
|
|
1381
1382
|
Object.prototype.hasOwnProperty.call(options.proxy, "router")
|
|
1382
1383
|
) {
|
|
1383
|
-
/** @type {
|
|
1384
|
+
/** @type {ProxyConfigArray} */
|
|
1384
1385
|
(options.proxy) = [/** @type {ProxyConfigMap} */ (options.proxy)];
|
|
1385
1386
|
} else {
|
|
1386
|
-
/** @type {
|
|
1387
|
+
/** @type {ProxyConfigArray} */
|
|
1387
1388
|
(options.proxy) = Object.keys(options.proxy).map(
|
|
1388
1389
|
/**
|
|
1389
1390
|
* @param {string} context
|
|
@@ -1421,50 +1422,48 @@ class Server {
|
|
|
1421
1422
|
}
|
|
1422
1423
|
}
|
|
1423
1424
|
|
|
1424
|
-
/** @type {
|
|
1425
|
+
/** @type {ProxyConfigArray} */
|
|
1425
1426
|
(options.proxy) =
|
|
1426
|
-
/** @type {
|
|
1427
|
-
(options.proxy).map(
|
|
1427
|
+
/** @type {ProxyConfigArray} */
|
|
1428
|
+
(options.proxy).map((item) => {
|
|
1429
|
+
if (typeof item === "function") {
|
|
1430
|
+
return item;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1428
1433
|
/**
|
|
1429
|
-
* @param {
|
|
1430
|
-
* @returns {
|
|
1434
|
+
* @param {"info" | "warn" | "error" | "debug" | "silent" | undefined | "none" | "log" | "verbose"} level
|
|
1435
|
+
* @returns {"info" | "warn" | "error" | "debug" | "silent" | undefined}
|
|
1431
1436
|
*/
|
|
1432
|
-
(
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
*/
|
|
1437
|
-
const getLogLevelForProxy = (level) => {
|
|
1438
|
-
if (level === "none") {
|
|
1439
|
-
return "silent";
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
if (level === "log") {
|
|
1443
|
-
return "info";
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
if (level === "verbose") {
|
|
1447
|
-
return "debug";
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
return level;
|
|
1451
|
-
};
|
|
1437
|
+
const getLogLevelForProxy = (level) => {
|
|
1438
|
+
if (level === "none") {
|
|
1439
|
+
return "silent";
|
|
1440
|
+
}
|
|
1452
1441
|
|
|
1453
|
-
if (
|
|
1454
|
-
|
|
1455
|
-
compilerOptions.infrastructureLogging
|
|
1456
|
-
? compilerOptions.infrastructureLogging.level
|
|
1457
|
-
: "info"
|
|
1458
|
-
);
|
|
1442
|
+
if (level === "log") {
|
|
1443
|
+
return "info";
|
|
1459
1444
|
}
|
|
1460
1445
|
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1446
|
+
if (level === "verbose") {
|
|
1447
|
+
return "debug";
|
|
1463
1448
|
}
|
|
1464
1449
|
|
|
1465
|
-
return
|
|
1450
|
+
return level;
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
if (typeof item.logLevel === "undefined") {
|
|
1454
|
+
item.logLevel = getLogLevelForProxy(
|
|
1455
|
+
compilerOptions.infrastructureLogging
|
|
1456
|
+
? compilerOptions.infrastructureLogging.level
|
|
1457
|
+
: "info"
|
|
1458
|
+
);
|
|
1466
1459
|
}
|
|
1467
|
-
|
|
1460
|
+
|
|
1461
|
+
if (typeof item.logProvider === "undefined") {
|
|
1462
|
+
item.logProvider = () => this.logger;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
return item;
|
|
1466
|
+
});
|
|
1468
1467
|
}
|
|
1469
1468
|
|
|
1470
1469
|
if (typeof options.setupExitSignals === "undefined") {
|
|
@@ -1478,13 +1477,7 @@ class Server {
|
|
|
1478
1477
|
} else if (typeof options.static === "string") {
|
|
1479
1478
|
options.static = [getStaticItem(options.static)];
|
|
1480
1479
|
} else if (Array.isArray(options.static)) {
|
|
1481
|
-
options.static = options.static.map((item) =>
|
|
1482
|
-
if (typeof item === "string") {
|
|
1483
|
-
return getStaticItem(item);
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
return getStaticItem(item);
|
|
1487
|
-
});
|
|
1480
|
+
options.static = options.static.map((item) => getStaticItem(item));
|
|
1488
1481
|
} else {
|
|
1489
1482
|
options.static = [getStaticItem(options.static)];
|
|
1490
1483
|
}
|
|
@@ -2130,7 +2123,7 @@ class Server {
|
|
|
2130
2123
|
const { createProxyMiddleware } = require("http-proxy-middleware");
|
|
2131
2124
|
|
|
2132
2125
|
/**
|
|
2133
|
-
* @param {
|
|
2126
|
+
* @param {ProxyConfigArrayItem} proxyConfig
|
|
2134
2127
|
* @returns {RequestHandler | undefined}
|
|
2135
2128
|
*/
|
|
2136
2129
|
const getProxyMiddleware = (proxyConfig) => {
|
|
@@ -2166,93 +2159,91 @@ class Server {
|
|
|
2166
2159
|
* }
|
|
2167
2160
|
* ]
|
|
2168
2161
|
*/
|
|
2169
|
-
/** @type {
|
|
2170
|
-
(this.options.proxy).forEach(
|
|
2162
|
+
/** @type {ProxyConfigArray} */
|
|
2163
|
+
(this.options.proxy).forEach((proxyConfigOrCallback) => {
|
|
2171
2164
|
/**
|
|
2172
|
-
* @
|
|
2165
|
+
* @type {RequestHandler}
|
|
2173
2166
|
*/
|
|
2174
|
-
|
|
2175
|
-
/**
|
|
2176
|
-
* @type {RequestHandler}
|
|
2177
|
-
*/
|
|
2178
|
-
let proxyMiddleware;
|
|
2167
|
+
let proxyMiddleware;
|
|
2179
2168
|
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2169
|
+
let proxyConfig =
|
|
2170
|
+
typeof proxyConfigOrCallback === "function"
|
|
2171
|
+
? proxyConfigOrCallback()
|
|
2172
|
+
: proxyConfigOrCallback;
|
|
2184
2173
|
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2174
|
+
proxyMiddleware =
|
|
2175
|
+
/** @type {RequestHandler} */
|
|
2176
|
+
(getProxyMiddleware(proxyConfig));
|
|
2188
2177
|
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2178
|
+
if (proxyConfig.ws) {
|
|
2179
|
+
this.webSocketProxies.push(proxyMiddleware);
|
|
2180
|
+
}
|
|
2192
2181
|
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
}
|
|
2182
|
+
/**
|
|
2183
|
+
* @param {Request} req
|
|
2184
|
+
* @param {Response} res
|
|
2185
|
+
* @param {NextFunction} next
|
|
2186
|
+
* @returns {Promise<void>}
|
|
2187
|
+
*/
|
|
2188
|
+
const handler = async (req, res, next) => {
|
|
2189
|
+
if (typeof proxyConfigOrCallback === "function") {
|
|
2190
|
+
const newProxyConfig = proxyConfigOrCallback(req, res, next);
|
|
2191
|
+
|
|
2192
|
+
if (newProxyConfig !== proxyConfig) {
|
|
2193
|
+
proxyConfig = newProxyConfig;
|
|
2194
|
+
proxyMiddleware =
|
|
2195
|
+
/** @type {RequestHandler} */
|
|
2196
|
+
(getProxyMiddleware(proxyConfig));
|
|
2209
2197
|
}
|
|
2198
|
+
}
|
|
2210
2199
|
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
}
|
|
2200
|
+
// - Check if we have a bypass function defined
|
|
2201
|
+
// - In case the bypass function is defined we'll retrieve the
|
|
2202
|
+
// bypassUrl from it otherwise bypassUrl would be null
|
|
2203
|
+
// TODO remove in the next major in favor `context` and `router` options
|
|
2204
|
+
const isByPassFuncDefined = typeof proxyConfig.bypass === "function";
|
|
2205
|
+
const bypassUrl = isByPassFuncDefined
|
|
2206
|
+
? await /** @type {ByPass} */ (proxyConfig.bypass)(
|
|
2207
|
+
req,
|
|
2208
|
+
res,
|
|
2209
|
+
proxyConfig
|
|
2210
|
+
)
|
|
2211
|
+
: null;
|
|
2212
|
+
|
|
2213
|
+
if (typeof bypassUrl === "boolean") {
|
|
2214
|
+
// skip the proxy
|
|
2215
|
+
// @ts-ignore
|
|
2216
|
+
req.url = null;
|
|
2217
|
+
next();
|
|
2218
|
+
} else if (typeof bypassUrl === "string") {
|
|
2219
|
+
// byPass to that url
|
|
2220
|
+
req.url = bypassUrl;
|
|
2221
|
+
next();
|
|
2222
|
+
} else if (proxyMiddleware) {
|
|
2223
|
+
return proxyMiddleware(req, res, next);
|
|
2224
|
+
} else {
|
|
2225
|
+
next();
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2236
2228
|
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
);
|
|
2229
|
+
middlewares.push({
|
|
2230
|
+
name: "http-proxy-middleware",
|
|
2231
|
+
middleware: handler,
|
|
2232
|
+
});
|
|
2233
|
+
// Also forward error requests to the proxy so it can handle them.
|
|
2234
|
+
middlewares.push({
|
|
2235
|
+
name: "http-proxy-middleware-error-handler",
|
|
2236
|
+
middleware:
|
|
2237
|
+
/**
|
|
2238
|
+
* @param {Error} error
|
|
2239
|
+
* @param {Request} req
|
|
2240
|
+
* @param {Response} res
|
|
2241
|
+
* @param {NextFunction} next
|
|
2242
|
+
* @returns {any}
|
|
2243
|
+
*/
|
|
2244
|
+
(error, req, res, next) => handler(req, res, next),
|
|
2245
|
+
});
|
|
2246
|
+
});
|
|
2256
2247
|
|
|
2257
2248
|
middlewares.push({
|
|
2258
2249
|
name: "webpack-dev-middleware",
|
|
@@ -2375,10 +2366,6 @@ class Server {
|
|
|
2375
2366
|
});
|
|
2376
2367
|
}
|
|
2377
2368
|
|
|
2378
|
-
if (typeof this.options.onAfterSetupMiddleware === "function") {
|
|
2379
|
-
this.options.onAfterSetupMiddleware(this);
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2382
2369
|
if (typeof this.options.setupMiddlewares === "function") {
|
|
2383
2370
|
middlewares = this.options.setupMiddlewares(middlewares, this);
|
|
2384
2371
|
}
|
|
@@ -2395,6 +2382,10 @@ class Server {
|
|
|
2395
2382
|
(this.app).use(middleware.middleware);
|
|
2396
2383
|
}
|
|
2397
2384
|
});
|
|
2385
|
+
|
|
2386
|
+
if (typeof this.options.onAfterSetupMiddleware === "function") {
|
|
2387
|
+
this.options.onAfterSetupMiddleware(this);
|
|
2388
|
+
}
|
|
2398
2389
|
}
|
|
2399
2390
|
|
|
2400
2391
|
/**
|
package/lib/options.json
CHANGED
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"description": "Allows to broadcasts dev server via ZeroConf networking on start.",
|
|
40
|
-
"link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour"
|
|
40
|
+
"link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour",
|
|
41
|
+
"cli": {
|
|
42
|
+
"negatedDescription": "Disallows to broadcasts dev server via ZeroConf networking on start."
|
|
43
|
+
}
|
|
41
44
|
},
|
|
42
45
|
"Client": {
|
|
43
46
|
"description": "Allows to specify options for client script in the browser or disable client script.",
|
|
@@ -82,7 +85,10 @@
|
|
|
82
85
|
{
|
|
83
86
|
"description": "Enables a full-screen overlay in the browser when there are compiler errors or warnings.",
|
|
84
87
|
"link": "https://webpack.js.org/configuration/dev-server/#overlay",
|
|
85
|
-
"type": "boolean"
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"cli": {
|
|
90
|
+
"negatedDescription": "Disables a full-screen overlay in the browser when there are compiler errors or warnings."
|
|
91
|
+
}
|
|
86
92
|
},
|
|
87
93
|
{
|
|
88
94
|
"type": "object",
|
|
@@ -103,7 +109,10 @@
|
|
|
103
109
|
"ClientProgress": {
|
|
104
110
|
"description": "Prints compilation progress in percentage in the browser.",
|
|
105
111
|
"link": "https://webpack.js.org/configuration/dev-server/#progress",
|
|
106
|
-
"type": "boolean"
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"cli": {
|
|
114
|
+
"negatedDescription": "Does not print compilation progress in percentage in the browser."
|
|
115
|
+
}
|
|
107
116
|
},
|
|
108
117
|
"ClientReconnect": {
|
|
109
118
|
"description": "Tells dev-server the number of times it should try to reconnect the client.",
|
|
@@ -116,7 +125,10 @@
|
|
|
116
125
|
"type": "number",
|
|
117
126
|
"minimum": 0
|
|
118
127
|
}
|
|
119
|
-
]
|
|
128
|
+
],
|
|
129
|
+
"cli": {
|
|
130
|
+
"negatedDescription": "Tells dev-server to not to try to connect the client."
|
|
131
|
+
}
|
|
120
132
|
},
|
|
121
133
|
"ClientWebSocketTransport": {
|
|
122
134
|
"anyOf": [
|
|
@@ -197,7 +209,10 @@
|
|
|
197
209
|
"Compress": {
|
|
198
210
|
"type": "boolean",
|
|
199
211
|
"description": "Enables gzip compression for everything served.",
|
|
200
|
-
"link": "https://webpack.js.org/configuration/dev-server/#devservercompress"
|
|
212
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devservercompress",
|
|
213
|
+
"cli": {
|
|
214
|
+
"negatedDescription": "Disables gzip compression for everything served."
|
|
215
|
+
}
|
|
201
216
|
},
|
|
202
217
|
"DevMiddleware": {
|
|
203
218
|
"description": "Provide options to 'webpack-dev-middleware' which handles webpack assets.",
|
|
@@ -208,12 +223,18 @@
|
|
|
208
223
|
"HTTP2": {
|
|
209
224
|
"type": "boolean",
|
|
210
225
|
"description": "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.",
|
|
211
|
-
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2"
|
|
226
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2",
|
|
227
|
+
"cli": {
|
|
228
|
+
"negatedDescription": "Does not serve over HTTP/2 using SPDY."
|
|
229
|
+
}
|
|
212
230
|
},
|
|
213
231
|
"HTTPS": {
|
|
214
232
|
"anyOf": [
|
|
215
233
|
{
|
|
216
|
-
"type": "boolean"
|
|
234
|
+
"type": "boolean",
|
|
235
|
+
"cli": {
|
|
236
|
+
"negatedDescription": "Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP)."
|
|
237
|
+
}
|
|
217
238
|
},
|
|
218
239
|
{
|
|
219
240
|
"type": "object",
|
|
@@ -225,7 +246,10 @@
|
|
|
225
246
|
},
|
|
226
247
|
"requestCert": {
|
|
227
248
|
"type": "boolean",
|
|
228
|
-
"description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option."
|
|
249
|
+
"description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.",
|
|
250
|
+
"cli": {
|
|
251
|
+
"negatedDescription": "Does not request for an SSL certificate."
|
|
252
|
+
}
|
|
229
253
|
},
|
|
230
254
|
"ca": {
|
|
231
255
|
"anyOf": [
|
|
@@ -458,7 +482,10 @@
|
|
|
458
482
|
}
|
|
459
483
|
],
|
|
460
484
|
"description": "Enables Hot Module Replacement.",
|
|
461
|
-
"link": "https://webpack.js.org/configuration/dev-server/#devserverhot"
|
|
485
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devserverhot",
|
|
486
|
+
"cli": {
|
|
487
|
+
"negatedDescription": "Disables Hot Module Replacement."
|
|
488
|
+
}
|
|
462
489
|
},
|
|
463
490
|
"IPC": {
|
|
464
491
|
"anyOf": [
|
|
@@ -477,11 +504,17 @@
|
|
|
477
504
|
"LiveReload": {
|
|
478
505
|
"type": "boolean",
|
|
479
506
|
"description": "Enables reload/refresh the page(s) when file changes are detected (enabled by default).",
|
|
507
|
+
"cli": {
|
|
508
|
+
"negatedDescription": "Disables reload/refresh the page(s) when file changes are detected (enabled by default)."
|
|
509
|
+
},
|
|
480
510
|
"link": "https://webpack.js.org/configuration/dev-server/#devserverlivereload"
|
|
481
511
|
},
|
|
482
512
|
"MagicHTML": {
|
|
483
513
|
"type": "boolean",
|
|
484
514
|
"description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
|
|
515
|
+
"cli": {
|
|
516
|
+
"negatedDescription": "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js')."
|
|
517
|
+
},
|
|
485
518
|
"link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml"
|
|
486
519
|
},
|
|
487
520
|
"OnAfterSetupMiddleware": {
|
|
@@ -528,7 +561,10 @@
|
|
|
528
561
|
"link": "https://webpack.js.org/configuration/dev-server/#devserveropen"
|
|
529
562
|
},
|
|
530
563
|
"OpenBoolean": {
|
|
531
|
-
"type": "boolean"
|
|
564
|
+
"type": "boolean",
|
|
565
|
+
"cli": {
|
|
566
|
+
"negatedDescription": "Does not open the default browser."
|
|
567
|
+
}
|
|
532
568
|
},
|
|
533
569
|
"OpenObject": {
|
|
534
570
|
"type": "object",
|
|
@@ -581,7 +617,10 @@
|
|
|
581
617
|
{
|
|
582
618
|
"type": "string",
|
|
583
619
|
"minLength": 1,
|
|
584
|
-
"description": "Open specified browser.
|
|
620
|
+
"description": "Open specified browser.",
|
|
621
|
+
"cli": {
|
|
622
|
+
"description": "Open specified browser. Deprecated: please use '--open-app-name'."
|
|
623
|
+
}
|
|
585
624
|
}
|
|
586
625
|
],
|
|
587
626
|
"description": "Open specified browser."
|
|
@@ -931,6 +970,9 @@
|
|
|
931
970
|
}
|
|
932
971
|
],
|
|
933
972
|
"description": "Tells dev server to use serveIndex middleware when enabled.",
|
|
973
|
+
"cli": {
|
|
974
|
+
"negatedDescription": "Does not tell dev server to use serveIndex middleware."
|
|
975
|
+
},
|
|
934
976
|
"link": "https://webpack.js.org/configuration/dev-server/#serveindex"
|
|
935
977
|
},
|
|
936
978
|
"watch": {
|
|
@@ -945,6 +987,9 @@
|
|
|
945
987
|
}
|
|
946
988
|
],
|
|
947
989
|
"description": "Watches for files in static content directory.",
|
|
990
|
+
"cli": {
|
|
991
|
+
"negatedDescription": "Does not watch for files in static content directory."
|
|
992
|
+
},
|
|
948
993
|
"link": "https://webpack.js.org/configuration/dev-server/#watch"
|
|
949
994
|
}
|
|
950
995
|
}
|
|
@@ -1043,7 +1088,9 @@
|
|
|
1043
1088
|
"$ref": "#/definitions/WebSocketServerType"
|
|
1044
1089
|
}
|
|
1045
1090
|
],
|
|
1046
|
-
"
|
|
1091
|
+
"cli": {
|
|
1092
|
+
"description": "Deprecated: please use '--web-socket-server-type' option."
|
|
1093
|
+
}
|
|
1047
1094
|
},
|
|
1048
1095
|
"WebSocketServerFunction": {
|
|
1049
1096
|
"instanceof": "Function"
|