first commit
This commit is contained in:
75
app_vue/node_modules/webpack/hot/dev-server.js
generated
vendored
Normal file
75
app_vue/node_modules/webpack/hot/dev-server.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
/* globals __webpack_hash__ */
|
||||
if (module.hot) {
|
||||
/** @type {undefined|string} */
|
||||
var lastHash;
|
||||
var upToDate = function upToDate() {
|
||||
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
|
||||
};
|
||||
var log = require("./log");
|
||||
var check = function check() {
|
||||
module.hot
|
||||
.check(true)
|
||||
.then(function (updatedModules) {
|
||||
if (!updatedModules) {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] Cannot find update. " +
|
||||
(typeof window !== "undefined"
|
||||
? "Need to do a full reload!"
|
||||
: "Please reload manually!")
|
||||
);
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] (Probably because of restarting the webpack-dev-server)"
|
||||
);
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!upToDate()) {
|
||||
check();
|
||||
}
|
||||
|
||||
require("./log-apply-result")(updatedModules, updatedModules);
|
||||
|
||||
if (upToDate()) {
|
||||
log("info", "[HMR] App is up to date.");
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
var status = module.hot.status();
|
||||
if (["abort", "fail"].indexOf(status) >= 0) {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] Cannot apply update. " +
|
||||
(typeof window !== "undefined"
|
||||
? "Need to do a full reload!"
|
||||
: "Please reload manually!")
|
||||
);
|
||||
log("warning", "[HMR] " + log.formatError(err));
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.reload();
|
||||
}
|
||||
} else {
|
||||
log("warning", "[HMR] Update failed: " + log.formatError(err));
|
||||
}
|
||||
});
|
||||
};
|
||||
var hotEmitter = require("./emitter");
|
||||
hotEmitter.on("webpackHotUpdate", function (currentHash) {
|
||||
lastHash = currentHash;
|
||||
if (!upToDate() && module.hot.status() === "idle") {
|
||||
log("info", "[HMR] Checking for updates on the server...");
|
||||
check();
|
||||
}
|
||||
});
|
||||
log("info", "[HMR] Waiting for update signal from WDS...");
|
||||
} else {
|
||||
throw new Error("[HMR] Hot Module Replacement is disabled.");
|
||||
}
|
2
app_vue/node_modules/webpack/hot/emitter.js
generated
vendored
Normal file
2
app_vue/node_modules/webpack/hot/emitter.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
var EventEmitter = require("events");
|
||||
module.exports = new EventEmitter();
|
50
app_vue/node_modules/webpack/hot/lazy-compilation-node.js
generated
vendored
Normal file
50
app_vue/node_modules/webpack/hot/lazy-compilation-node.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/* global __resourceQuery */
|
||||
|
||||
"use strict";
|
||||
|
||||
var urlBase = decodeURIComponent(__resourceQuery.slice(1));
|
||||
|
||||
/**
|
||||
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
|
||||
* @returns {() => void} function to destroy response
|
||||
*/
|
||||
exports.keepAlive = function (options) {
|
||||
var data = options.data;
|
||||
var onError = options.onError;
|
||||
var active = options.active;
|
||||
var module = options.module;
|
||||
/** @type {import("http").IncomingMessage} */
|
||||
var response;
|
||||
var request = (
|
||||
urlBase.startsWith("https") ? require("https") : require("http")
|
||||
).request(
|
||||
urlBase + data,
|
||||
{
|
||||
agent: false,
|
||||
headers: { accept: "text/event-stream" }
|
||||
},
|
||||
function (res) {
|
||||
response = res;
|
||||
response.on("error", errorHandler);
|
||||
if (!active && !module.hot) {
|
||||
console.log(
|
||||
"Hot Module Replacement is not enabled. Waiting for process restart..."
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {Error} err error
|
||||
*/
|
||||
function errorHandler(err) {
|
||||
err.message =
|
||||
"Problem communicating active modules to the server: " + err.message;
|
||||
onError(err);
|
||||
}
|
||||
request.on("error", errorHandler);
|
||||
request.end();
|
||||
return function () {
|
||||
response.destroy();
|
||||
};
|
||||
};
|
83
app_vue/node_modules/webpack/hot/lazy-compilation-web.js
generated
vendored
Normal file
83
app_vue/node_modules/webpack/hot/lazy-compilation-web.js
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
/* global __resourceQuery */
|
||||
|
||||
"use strict";
|
||||
|
||||
if (typeof EventSource !== "function") {
|
||||
throw new Error(
|
||||
"Environment doesn't support lazy compilation (requires EventSource)"
|
||||
);
|
||||
}
|
||||
|
||||
var urlBase = decodeURIComponent(__resourceQuery.slice(1));
|
||||
/** @type {EventSource | undefined} */
|
||||
var activeEventSource;
|
||||
var activeKeys = new Map();
|
||||
var errorHandlers = new Set();
|
||||
|
||||
var updateEventSource = function updateEventSource() {
|
||||
if (activeEventSource) activeEventSource.close();
|
||||
if (activeKeys.size) {
|
||||
activeEventSource = new EventSource(
|
||||
urlBase + Array.from(activeKeys.keys()).join("@")
|
||||
);
|
||||
/**
|
||||
* @this {EventSource}
|
||||
* @param {Event & { message?: string, filename?: string, lineno?: number, colno?: number, error?: Error }} event event
|
||||
*/
|
||||
activeEventSource.onerror = function (event) {
|
||||
errorHandlers.forEach(function (onError) {
|
||||
onError(
|
||||
new Error(
|
||||
"Problem communicating active modules to the server: " +
|
||||
event.message +
|
||||
" " +
|
||||
event.filename +
|
||||
":" +
|
||||
event.lineno +
|
||||
":" +
|
||||
event.colno +
|
||||
" " +
|
||||
event.error
|
||||
)
|
||||
);
|
||||
});
|
||||
};
|
||||
} else {
|
||||
activeEventSource = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
|
||||
* @returns {() => void} function to destroy response
|
||||
*/
|
||||
exports.keepAlive = function (options) {
|
||||
var data = options.data;
|
||||
var onError = options.onError;
|
||||
var active = options.active;
|
||||
var module = options.module;
|
||||
errorHandlers.add(onError);
|
||||
var value = activeKeys.get(data) || 0;
|
||||
activeKeys.set(data, value + 1);
|
||||
if (value === 0) {
|
||||
updateEventSource();
|
||||
}
|
||||
if (!active && !module.hot) {
|
||||
console.log(
|
||||
"Hot Module Replacement is not enabled. Waiting for process restart..."
|
||||
);
|
||||
}
|
||||
|
||||
return function () {
|
||||
errorHandlers.delete(onError);
|
||||
setTimeout(function () {
|
||||
var value = activeKeys.get(data);
|
||||
if (value === 1) {
|
||||
activeKeys.delete(data);
|
||||
updateEventSource();
|
||||
} else {
|
||||
activeKeys.set(data, value - 1);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
};
|
49
app_vue/node_modules/webpack/hot/log-apply-result.js
generated
vendored
Normal file
49
app_vue/node_modules/webpack/hot/log-apply-result.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {(string | number)[]} updatedModules updated modules
|
||||
* @param {(string | number)[] | null} renewedModules renewed modules
|
||||
*/
|
||||
module.exports = function (updatedModules, renewedModules) {
|
||||
var unacceptedModules = updatedModules.filter(function (moduleId) {
|
||||
return renewedModules && renewedModules.indexOf(moduleId) < 0;
|
||||
});
|
||||
var log = require("./log");
|
||||
|
||||
if (unacceptedModules.length > 0) {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] The following modules couldn't be hot updated: (They would need a full reload!)"
|
||||
);
|
||||
unacceptedModules.forEach(function (moduleId) {
|
||||
log("warning", "[HMR] - " + moduleId);
|
||||
});
|
||||
}
|
||||
|
||||
if (!renewedModules || renewedModules.length === 0) {
|
||||
log("info", "[HMR] Nothing hot updated.");
|
||||
} else {
|
||||
log("info", "[HMR] Updated modules:");
|
||||
renewedModules.forEach(function (moduleId) {
|
||||
if (typeof moduleId === "string" && moduleId.indexOf("!") !== -1) {
|
||||
var parts = moduleId.split("!");
|
||||
log.groupCollapsed("info", "[HMR] - " + parts.pop());
|
||||
log("info", "[HMR] - " + moduleId);
|
||||
log.groupEnd("info");
|
||||
} else {
|
||||
log("info", "[HMR] - " + moduleId);
|
||||
}
|
||||
});
|
||||
var numberIds = renewedModules.every(function (moduleId) {
|
||||
return typeof moduleId === "number";
|
||||
});
|
||||
if (numberIds)
|
||||
log(
|
||||
"info",
|
||||
'[HMR] Consider using the optimization.moduleIds: "named" for module names.'
|
||||
);
|
||||
}
|
||||
};
|
78
app_vue/node_modules/webpack/hot/log.js
generated
vendored
Normal file
78
app_vue/node_modules/webpack/hot/log.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
/** @typedef {"info" | "warning" | "error"} LogLevel */
|
||||
|
||||
/** @type {LogLevel} */
|
||||
var logLevel = "info";
|
||||
|
||||
function dummy() {}
|
||||
|
||||
/**
|
||||
* @param {LogLevel} level log level
|
||||
* @returns {boolean} true, if should log
|
||||
*/
|
||||
function shouldLog(level) {
|
||||
var shouldLog =
|
||||
(logLevel === "info" && level === "info") ||
|
||||
(["info", "warning"].indexOf(logLevel) >= 0 && level === "warning") ||
|
||||
(["info", "warning", "error"].indexOf(logLevel) >= 0 && level === "error");
|
||||
return shouldLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {(msg?: string) => void} logFn log function
|
||||
* @returns {(level: LogLevel, msg?: string) => void} function that logs when log level is sufficient
|
||||
*/
|
||||
function logGroup(logFn) {
|
||||
return function (level, msg) {
|
||||
if (shouldLog(level)) {
|
||||
logFn(msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {LogLevel} level log level
|
||||
* @param {string|Error} msg message
|
||||
*/
|
||||
module.exports = function (level, msg) {
|
||||
if (shouldLog(level)) {
|
||||
if (level === "info") {
|
||||
console.log(msg);
|
||||
} else if (level === "warning") {
|
||||
console.warn(msg);
|
||||
} else if (level === "error") {
|
||||
console.error(msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var group = console.group || dummy;
|
||||
var groupCollapsed = console.groupCollapsed || dummy;
|
||||
var groupEnd = console.groupEnd || dummy;
|
||||
|
||||
module.exports.group = logGroup(group);
|
||||
|
||||
module.exports.groupCollapsed = logGroup(groupCollapsed);
|
||||
|
||||
module.exports.groupEnd = logGroup(groupEnd);
|
||||
|
||||
/**
|
||||
* @param {LogLevel} level log level
|
||||
*/
|
||||
module.exports.setLogLevel = function (level) {
|
||||
logLevel = level;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Error} err error
|
||||
* @returns {string} formatted error
|
||||
*/
|
||||
module.exports.formatError = function (err) {
|
||||
var message = err.message;
|
||||
var stack = err.stack;
|
||||
if (!stack) {
|
||||
return message;
|
||||
} else if (stack.indexOf(message) < 0) {
|
||||
return message + "\n" + stack;
|
||||
}
|
||||
return stack;
|
||||
};
|
103
app_vue/node_modules/webpack/hot/only-dev-server.js
generated
vendored
Normal file
103
app_vue/node_modules/webpack/hot/only-dev-server.js
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
/* globals __webpack_hash__ */
|
||||
if (module.hot) {
|
||||
/** @type {undefined|string} */
|
||||
var lastHash;
|
||||
var upToDate = function upToDate() {
|
||||
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
|
||||
};
|
||||
var log = require("./log");
|
||||
var check = function check() {
|
||||
module.hot
|
||||
.check()
|
||||
.then(function (updatedModules) {
|
||||
if (!updatedModules) {
|
||||
log("warning", "[HMR] Cannot find update. Need to do a full reload!");
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] (Probably because of restarting the webpack-dev-server)"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return module.hot
|
||||
.apply({
|
||||
ignoreUnaccepted: true,
|
||||
ignoreDeclined: true,
|
||||
ignoreErrored: true,
|
||||
onUnaccepted: function (data) {
|
||||
log(
|
||||
"warning",
|
||||
"Ignored an update to unaccepted module " +
|
||||
data.chain.join(" -> ")
|
||||
);
|
||||
},
|
||||
onDeclined: function (data) {
|
||||
log(
|
||||
"warning",
|
||||
"Ignored an update to declined module " +
|
||||
data.chain.join(" -> ")
|
||||
);
|
||||
},
|
||||
onErrored: function (data) {
|
||||
log("error", data.error);
|
||||
log(
|
||||
"warning",
|
||||
"Ignored an error while updating module " +
|
||||
data.moduleId +
|
||||
" (" +
|
||||
data.type +
|
||||
")"
|
||||
);
|
||||
}
|
||||
})
|
||||
.then(function (renewedModules) {
|
||||
if (!upToDate()) {
|
||||
check();
|
||||
}
|
||||
|
||||
require("./log-apply-result")(updatedModules, renewedModules);
|
||||
|
||||
if (upToDate()) {
|
||||
log("info", "[HMR] App is up to date.");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
var status = module.hot.status();
|
||||
if (["abort", "fail"].indexOf(status) >= 0) {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] Cannot check for update. Need to do a full reload!"
|
||||
);
|
||||
log("warning", "[HMR] " + log.formatError(err));
|
||||
} else {
|
||||
log("warning", "[HMR] Update check failed: " + log.formatError(err));
|
||||
}
|
||||
});
|
||||
};
|
||||
var hotEmitter = require("./emitter");
|
||||
hotEmitter.on("webpackHotUpdate", function (currentHash) {
|
||||
lastHash = currentHash;
|
||||
if (!upToDate()) {
|
||||
var status = module.hot.status();
|
||||
if (status === "idle") {
|
||||
log("info", "[HMR] Checking for updates on the server...");
|
||||
check();
|
||||
} else if (["abort", "fail"].indexOf(status) >= 0) {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] Cannot apply update as a previous update " +
|
||||
status +
|
||||
"ed. Need to do a full reload!"
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
log("info", "[HMR] Waiting for update signal from WDS...");
|
||||
} else {
|
||||
throw new Error("[HMR] Hot Module Replacement is disabled.");
|
||||
}
|
40
app_vue/node_modules/webpack/hot/poll.js
generated
vendored
Normal file
40
app_vue/node_modules/webpack/hot/poll.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
/* globals __resourceQuery */
|
||||
if (module.hot) {
|
||||
var hotPollInterval = +__resourceQuery.slice(1) || 10 * 60 * 1000;
|
||||
var log = require("./log");
|
||||
|
||||
/**
|
||||
* @param {boolean=} fromUpdate true when called from update
|
||||
*/
|
||||
var checkForUpdate = function checkForUpdate(fromUpdate) {
|
||||
if (module.hot.status() === "idle") {
|
||||
module.hot
|
||||
.check(true)
|
||||
.then(function (updatedModules) {
|
||||
if (!updatedModules) {
|
||||
if (fromUpdate) log("info", "[HMR] Update applied.");
|
||||
return;
|
||||
}
|
||||
require("./log-apply-result")(updatedModules, updatedModules);
|
||||
checkForUpdate(true);
|
||||
})
|
||||
.catch(function (err) {
|
||||
var status = module.hot.status();
|
||||
if (["abort", "fail"].indexOf(status) >= 0) {
|
||||
log("warning", "[HMR] Cannot apply update.");
|
||||
log("warning", "[HMR] " + log.formatError(err));
|
||||
log("warning", "[HMR] You need to restart the application!");
|
||||
} else {
|
||||
log("warning", "[HMR] Update failed: " + log.formatError(err));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
setInterval(checkForUpdate, hotPollInterval);
|
||||
} else {
|
||||
throw new Error("[HMR] Hot Module Replacement is disabled.");
|
||||
}
|
66
app_vue/node_modules/webpack/hot/signal.js
generated
vendored
Normal file
66
app_vue/node_modules/webpack/hot/signal.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
/* globals __resourceQuery */
|
||||
if (module.hot) {
|
||||
var log = require("./log");
|
||||
|
||||
/**
|
||||
* @param {boolean=} fromUpdate true when called from update
|
||||
*/
|
||||
var checkForUpdate = function checkForUpdate(fromUpdate) {
|
||||
module.hot
|
||||
.check()
|
||||
.then(function (updatedModules) {
|
||||
if (!updatedModules) {
|
||||
if (fromUpdate) log("info", "[HMR] Update applied.");
|
||||
else log("warning", "[HMR] Cannot find update.");
|
||||
return;
|
||||
}
|
||||
|
||||
return module.hot
|
||||
.apply({
|
||||
ignoreUnaccepted: true,
|
||||
onUnaccepted: function (data) {
|
||||
log(
|
||||
"warning",
|
||||
"Ignored an update to unaccepted module " +
|
||||
data.chain.join(" -> ")
|
||||
);
|
||||
}
|
||||
})
|
||||
.then(function (renewedModules) {
|
||||
require("./log-apply-result")(updatedModules, renewedModules);
|
||||
|
||||
checkForUpdate(true);
|
||||
return null;
|
||||
});
|
||||
})
|
||||
.catch(function (err) {
|
||||
var status = module.hot.status();
|
||||
if (["abort", "fail"].indexOf(status) >= 0) {
|
||||
log("warning", "[HMR] Cannot apply update.");
|
||||
log("warning", "[HMR] " + log.formatError(err));
|
||||
log("warning", "[HMR] You need to restart the application!");
|
||||
} else {
|
||||
log("warning", "[HMR] Update failed: " + (err.stack || err.message));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
process.on(__resourceQuery.slice(1) || "SIGUSR2", function () {
|
||||
if (module.hot.status() !== "idle") {
|
||||
log(
|
||||
"warning",
|
||||
"[HMR] Got signal but currently in " + module.hot.status() + " state."
|
||||
);
|
||||
log("warning", "[HMR] Need to be in idle state to start hot update.");
|
||||
return;
|
||||
}
|
||||
|
||||
checkForUpdate();
|
||||
});
|
||||
} else {
|
||||
throw new Error("[HMR] Hot Module Replacement is disabled.");
|
||||
}
|
Reference in New Issue
Block a user