updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

File diff suppressed because one or more lines are too long

View File

@@ -58,14 +58,22 @@ if (!urlParts.port || urlParts.port === '0') {
}
var _hot = false;
var _liveReload = false;
var initial = true;
var currentHash = '';
var useWarningOverlay = false;
var useErrorOverlay = false;
var useProgress = false;
var INFO = 'info';
var WARNING = 'warning';
var WARN = 'warn';
var ERROR = 'error';
var DEBUG = 'debug';
var TRACE = 'trace';
var SILENT = 'silent'; // deprecated
// TODO: remove these at major released
// https://github.com/webpack/webpack-dev-server/pull/1825
var WARNING = 'warning';
var NONE = 'none'; // Set the default log level
log.setDefaultLevel(INFO); // Send messages to the outside, so plugins can consume it.
@@ -84,10 +92,17 @@ var onSocketMsg = {
_hot = true;
log.info('[WDS] Hot Module Replacement enabled.');
},
liveReload: function liveReload() {
_liveReload = true;
log.info('[WDS] Live Reloading enabled.');
},
invalid: function invalid() {
log.info('[WDS] App updated. Recompiling...'); // fixes #1042. overlay doesn't clear if errors are fixed but warnings remain.
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
sendMsg('Invalid');
},
hash: function hash(_hash) {
@@ -95,7 +110,11 @@ var onSocketMsg = {
},
'still-ok': function stillOk() {
log.info('[WDS] Nothing changed.');
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
sendMsg('StillOk');
},
'log-level': function logLevel(level) {
@@ -107,16 +126,22 @@ var onSocketMsg = {
switch (level) {
case INFO:
case WARN:
case DEBUG:
case TRACE:
case ERROR:
log.setLevel(level);
break;
// deprecated
case WARNING:
// loglevel's warning name is different from webpack's
log.setLevel('warn');
break;
// deprecated
case NONE:
case SILENT:
log.disableAll();
break;
@@ -141,13 +166,23 @@ var onSocketMsg = {
}
},
'progress-update': function progressUpdate(data) {
if (useProgress) log.info("[WDS] ".concat(data.percent, "% - ").concat(data.msg, "."));
if (useProgress) {
log.info("[WDS] ".concat(data.percent, "% - ").concat(data.msg, "."));
}
sendMsg('Progress', data);
},
ok: function ok() {
sendMsg('Ok');
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (initial) return initial = false; // eslint-disable-line no-return-assign
if (useWarningOverlay || useErrorOverlay) {
overlay.clear();
}
if (initial) {
return initial = false;
} // eslint-disable-line no-return-assign
reloadApp();
},
@@ -168,8 +203,14 @@ var onSocketMsg = {
log.warn(strippedWarnings[i]);
}
if (useWarningOverlay) overlay.showMessage(_warnings);
if (initial) return initial = false; // eslint-disable-line no-return-assign
if (useWarningOverlay) {
overlay.showMessage(_warnings);
}
if (initial) {
return initial = false;
} // eslint-disable-line no-return-assign
reloadApp();
},
@@ -186,7 +227,10 @@ var onSocketMsg = {
log.error(strippedErrors[i]);
}
if (useErrorOverlay) overlay.showMessage(_errors);
if (useErrorOverlay) {
overlay.showMessage(_errors);
}
initial = false;
},
error: function error(_error) {
@@ -216,17 +260,33 @@ if (hostname === '0.0.0.0' || hostname === '::') {
if (hostname && (self.location.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {
protocol = self.location.protocol;
} // default values of the sock url if they are not provided
var sockHost = hostname;
var sockPath = '/sockjs-node';
var sockPort = urlParts.port;
if (urlParts.path !== null && // eslint-disable-next-line no-undefined
urlParts.path !== undefined && urlParts.path !== '/') {
var parsedQuery = querystring.parse(urlParts.path); // all of these sock url params are optionally passed in through
// __resourceQuery, so we need to fall back to the default if
// they are not provided
sockHost = parsedQuery.sockHost || sockHost;
sockPath = parsedQuery.sockPath || sockPath;
sockPort = parsedQuery.sockPort || sockPort;
}
var socketUrl = url.format({
protocol: protocol,
auth: urlParts.auth,
hostname: hostname,
port: urlParts.port,
hostname: sockHost,
port: sockPort,
// If sockPath is provided it'll be passed in via the __resourceQuery as a
// query param so it has to be parsed out of the querystring in order for the
// client to open the socket to the correct location.
pathname: urlParts.path == null || urlParts.path === '/' ? '/sockjs-node' : querystring.parse(urlParts.path).sockPath || urlParts.path
pathname: sockPath
});
socket(socketUrl, onSocketMsg);
var isUnloading = false;
@@ -250,23 +310,24 @@ function reloadApp() {
// broadcast update to window
self.postMessage("webpackHotUpdate".concat(currentHash), '*');
}
} else {
var rootWindow = self; // use parent window for reload (in case we're in an iframe with no valid src)
} // allow refreshing the page only if liveReload isn't disabled
else if (_liveReload) {
var rootWindow = self; // use parent window for reload (in case we're in an iframe with no valid src)
var intervalId = self.setInterval(function () {
if (rootWindow.location.protocol !== 'about:') {
// reload immediately if protocol is valid
applyReload(rootWindow, intervalId);
} else {
rootWindow = rootWindow.parent;
if (rootWindow.parent === rootWindow) {
// if parent equals current window we've reached the root which would continue forever, so trigger a reload anyways
var intervalId = self.setInterval(function () {
if (rootWindow.location.protocol !== 'about:') {
// reload immediately if protocol is valid
applyReload(rootWindow, intervalId);
} else {
rootWindow = rootWindow.parent;
if (rootWindow.parent === rootWindow) {
// if parent equals current window we've reached the root which would continue forever, so trigger a reload anyways
applyReload(rootWindow, intervalId);
}
}
}
});
}
});
}
function applyReload(rootWindow, intervalId) {
clearInterval(intervalId);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long