webpack-dev-server 5.0.3 → 5.1.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.
- package/README.md +1 -1
- package/client/clients/SockJSClient.js +5 -6
- package/client/clients/WebSocketClient.js +5 -6
- package/client/index.js +15 -2
- package/client/modules/logger/index.js +200 -113
- package/client/modules/sockjs-client/index.js +1 -1
- package/client/overlay/fsm.js +2 -2
- package/client/overlay.js +6 -6
- package/client/progress.js +124 -0
- package/client/utils/reloadApp.js +1 -1
- package/lib/Server.js +600 -369
- package/lib/options.json +23 -5
- package/package.json +30 -29
- package/types/bin/cli-flags.d.ts +15 -0
- package/types/lib/Server.d.ts +187 -282
- package/types/lib/servers/WebsocketServer.d.ts +0 -1
package/README.md
CHANGED
|
@@ -190,7 +190,7 @@ CLI documentation: https://webpack.js.org/api/cli/.
|
|
|
190
190
|
Made with ♥ by the webpack team.
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
>
|
|
193
|
+
> [!NOTE]
|
|
194
194
|
>
|
|
195
195
|
> _Detailed documentation for above options is available on this [link](https://webpack.js.org/configuration/dev-server/)._
|
|
196
196
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function _classCallCheck(
|
|
2
|
-
function _defineProperties(
|
|
3
|
-
function _createClass(
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
1
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import SockJS from "../modules/sockjs-client/index.js";
|
|
7
7
|
import { log } from "../utils/log.js";
|
|
@@ -25,7 +25,7 @@ var SockJSClient = /*#__PURE__*/function () {
|
|
|
25
25
|
/**
|
|
26
26
|
* @param {(...args: any[]) => void} f
|
|
27
27
|
*/
|
|
28
|
-
_createClass(SockJSClient, [{
|
|
28
|
+
return _createClass(SockJSClient, [{
|
|
29
29
|
key: "onOpen",
|
|
30
30
|
value: function onOpen(f) {
|
|
31
31
|
this.sock.onopen = f;
|
|
@@ -56,6 +56,5 @@ var SockJSClient = /*#__PURE__*/function () {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
}]);
|
|
59
|
-
return SockJSClient;
|
|
60
59
|
}();
|
|
61
60
|
export { SockJSClient as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function _classCallCheck(
|
|
2
|
-
function _defineProperties(
|
|
3
|
-
function _createClass(
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
1
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { log } from "../utils/log.js";
|
|
7
7
|
var WebSocketClient = /*#__PURE__*/function () {
|
|
@@ -19,7 +19,7 @@ var WebSocketClient = /*#__PURE__*/function () {
|
|
|
19
19
|
/**
|
|
20
20
|
* @param {(...args: any[]) => void} f
|
|
21
21
|
*/
|
|
22
|
-
_createClass(WebSocketClient, [{
|
|
22
|
+
return _createClass(WebSocketClient, [{
|
|
23
23
|
key: "onOpen",
|
|
24
24
|
value: function onOpen(f) {
|
|
25
25
|
this.client.onopen = f;
|
|
@@ -46,6 +46,5 @@ var WebSocketClient = /*#__PURE__*/function () {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
}]);
|
|
49
|
-
return WebSocketClient;
|
|
50
49
|
}();
|
|
51
50
|
export { WebSocketClient as default };
|
package/client/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
-
function _defineProperty(
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
/* global __resourceQuery, __webpack_hash__ */
|
|
7
7
|
/// <reference types="webpack/module" />
|
|
@@ -14,6 +14,7 @@ import { log, logEnabledFeatures, setLogLevel } from "./utils/log.js";
|
|
|
14
14
|
import sendMessage from "./utils/sendMessage.js";
|
|
15
15
|
import reloadApp from "./utils/reloadApp.js";
|
|
16
16
|
import createSocketURL from "./utils/createSocketURL.js";
|
|
17
|
+
import { isProgressSupported, defineProgressElement } from "./progress.js";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* @typedef {Object} OverlayOptions
|
|
@@ -205,6 +206,18 @@ var onSocketMessage = {
|
|
|
205
206
|
if (options.progress) {
|
|
206
207
|
log.info("".concat(data.pluginName ? "[".concat(data.pluginName, "] ") : "").concat(data.percent, "% - ").concat(data.msg, "."));
|
|
207
208
|
}
|
|
209
|
+
if (isProgressSupported()) {
|
|
210
|
+
if (typeof options.progress === "string") {
|
|
211
|
+
var progress = document.querySelector("wds-progress");
|
|
212
|
+
if (!progress) {
|
|
213
|
+
defineProgressElement();
|
|
214
|
+
progress = document.createElement("wds-progress");
|
|
215
|
+
document.body.appendChild(progress);
|
|
216
|
+
}
|
|
217
|
+
progress.setAttribute("progress", data.percent);
|
|
218
|
+
progress.setAttribute("type", options.progress);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
208
221
|
sendMessage("Progress", data);
|
|
209
222
|
},
|
|
210
223
|
"still-ok": function stillOk() {
|