socket-function 0.12.8 → 0.12.9
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.
|
@@ -42,6 +42,7 @@ declare global {
|
|
|
42
42
|
hotreload?: boolean;
|
|
43
43
|
/** Only hotreloads the file in the browser. */
|
|
44
44
|
hotreloadBrowser?: boolean;
|
|
45
|
+
noserverhotreload?: boolean;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -70,7 +71,7 @@ const hotReloadModule = cache((module: NodeJS.Module) => {
|
|
|
70
71
|
if (curr.mtime.getTime() === prev.mtime.getTime()) return;
|
|
71
72
|
console.log(`Hot reloading due to change: ${module.filename}`);
|
|
72
73
|
module.updateContents?.();
|
|
73
|
-
if (isNode()) {
|
|
74
|
+
if (isNode() && !module.noserverhotreload) {
|
|
74
75
|
if (
|
|
75
76
|
module.hotreload
|
|
76
77
|
// A fairly big hack (as this could just be in a string, or something similar), but... it also VERY useful
|
package/package.json
CHANGED
package/require/require.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
//# sourceURL=require.js
|
|
3
3
|
|
|
4
|
+
let startTime = Date.now();
|
|
5
|
+
|
|
4
6
|
// Globals
|
|
5
7
|
Object.assign(window, {
|
|
6
8
|
process: {
|
|
@@ -144,7 +146,7 @@
|
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
async function rootRequireMultiple(requests) {
|
|
147
|
-
console.log(`%cimport(${requests.join(", ")})`, "color: orange");
|
|
149
|
+
console.log(`%cimport(${requests.join(", ")}) at ${Date.now() - startTime}ms`, "color: orange");
|
|
148
150
|
|
|
149
151
|
let time = Date.now();
|
|
150
152
|
|
|
@@ -216,7 +218,7 @@
|
|
|
216
218
|
let moduleCount = Object.values(modules).filter(x => x.source).length;
|
|
217
219
|
let requireModuleCount = Object.values(modules).filter(x => !x.source).length;
|
|
218
220
|
let dependenciesOnlyText = requireModuleCount ? ` (+${requireModuleCount} dependencies only)` : "";
|
|
219
|
-
console.log(`%cimport(${requests.join(", ")}) download ${time}ms, ${Math.ceil(rawText.length / 1024)}KB, ${moduleCount} modules${dependenciesOnlyText}`, "color: green");
|
|
221
|
+
console.log(`%cimport(${requests.join(", ")}) finished download ${time}ms, ${Math.ceil(rawText.length / 1024)}KB, ${moduleCount} modules${dependenciesOnlyText} at ${Date.now() - startTime}ms`, "color: green");
|
|
220
222
|
|
|
221
223
|
time = Date.now();
|
|
222
224
|
|
|
@@ -234,7 +236,7 @@
|
|
|
234
236
|
return requestsResolvedPaths.map(x => getModule(x));
|
|
235
237
|
} finally {
|
|
236
238
|
time = Date.now() - time;
|
|
237
|
-
console.log(`%cimport(${requests.join(", ")}) evaluate ${time}ms (${moduleCount} modules)`, "color: blue");
|
|
239
|
+
console.log(`%cimport(${requests.join(", ")}) finished evaluate ${time}ms (${moduleCount} modules) at ${Date.now() - startTime}ms`, "color: blue");
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
242
|
|