webpack-dev-server 2.4.5 → 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.
- package/bin/webpack-dev-server.js +45 -4
- package/client/index.bundle.js +1 -1
- package/client/index.js +8 -4
- package/client/live.bundle.js +3 -3
- package/client/sockjs.bundle.js +1 -1
- package/lib/Server.js +56 -8
- package/lib/optionsSchema.json +20 -1
- package/lib/util/createDomain.js +2 -1
- package/package.json +5 -1
- package/ssl/.gitkeep +0 -0
- package/ssl/server.pem +0 -46
package/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* global __resourceQuery */
|
|
1
|
+
/* global __resourceQuery WorkerGlobalScope */
|
|
2
2
|
var url = require("url");
|
|
3
3
|
var stripAnsi = require("strip-ansi");
|
|
4
4
|
var socket = require("./socket");
|
|
@@ -47,7 +47,11 @@ function log(level, msg) {
|
|
|
47
47
|
|
|
48
48
|
// Send messages to the outside, so plugins can consume it.
|
|
49
49
|
function sendMsg(type, data) {
|
|
50
|
-
if(
|
|
50
|
+
if(
|
|
51
|
+
typeof self !== "undefined" &&
|
|
52
|
+
(typeof WorkerGlobalScope === "undefined" ||
|
|
53
|
+
!(self instanceof WorkerGlobalScope))
|
|
54
|
+
) {
|
|
51
55
|
self.postMessage({
|
|
52
56
|
type: "webpack" + type,
|
|
53
57
|
data: data
|
|
@@ -103,7 +107,7 @@ var onSocketMsg = {
|
|
|
103
107
|
});
|
|
104
108
|
sendMsg("Warnings", strippedWarnings);
|
|
105
109
|
for(var i = 0; i < strippedWarnings.length; i++)
|
|
106
|
-
|
|
110
|
+
log("warning", strippedWarnings[i]);
|
|
107
111
|
if(useWarningOverlay) overlay.showMessage(warnings);
|
|
108
112
|
|
|
109
113
|
if(initial) return initial = false;
|
|
@@ -116,7 +120,7 @@ var onSocketMsg = {
|
|
|
116
120
|
});
|
|
117
121
|
sendMsg("Errors", strippedErrors);
|
|
118
122
|
for(var i = 0; i < strippedErrors.length; i++)
|
|
119
|
-
|
|
123
|
+
log("error", strippedErrors[i]);
|
|
120
124
|
if(useErrorOverlay) overlay.showMessage(errors);
|
|
121
125
|
},
|
|
122
126
|
error: function(error) {
|