🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ecopages/core

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ecopages/core - npm Package Compare versions

Comparing version
0.2.0-beta.21
to
0.2.0-beta.22
+2
-2
package.json
{
"name": "@ecopages/core",
"version": "0.2.0-beta.21",
"version": "0.2.0-beta.22",
"description": "Core package for Ecopages",

@@ -20,3 +20,3 @@ "keywords": [

"dependencies": {
"@ecopages/file-system": "0.2.0-beta.21",
"@ecopages/file-system": "0.2.0-beta.22",
"@ecopages/logger": "^0.2.3",

@@ -23,0 +23,0 @@ "@ecopages/scripts-injector": "^0.1.5",

@@ -44,1 +44,7 @@ /**

export declare function isHmrOutputFresh(outputPath: string, sourcePath: string): boolean;
/**
* @remarks
* Missing output is treated as a benign rebuild race. This helper isolates the
* post-build case where a bundle exists but is still older than its source.
*/
export declare function isHmrOutputOlderThanSource(outputPath: string, sourcePath: string): boolean;

@@ -46,2 +46,8 @@ import fs from "node:fs";

}
function isHmrOutputOlderThanSource(outputPath, sourcePath) {
if (!fileSystem.exists(outputPath) || !fileSystem.exists(sourcePath)) {
return false;
}
return fs.statSync(outputPath).mtimeMs < fs.statSync(sourcePath).mtimeMs;
}
export {

@@ -51,2 +57,3 @@ encodeHmrDynamicSegments,

isHmrOutputFresh,
isHmrOutputOlderThanSource,
isRegisteredScriptEntrypoint,

@@ -53,0 +60,0 @@ removeStaleHmrEntrypointOutput,

@@ -9,3 +9,4 @@ import path from "node:path";

isRegisteredScriptEntrypoint,
isHmrOutputFresh
isHmrOutputFresh,
isHmrOutputOlderThanSource
} from "../hmr-entrypoint-output.js";

@@ -204,3 +205,7 @@ class JsHmrStrategy extends HmrStrategy {

if (sourcePath && !isHmrOutputFresh(filepath, sourcePath)) {
appLogger.warn(`[JsHmrStrategy] Skipping broadcast for stale HMR output ${url}`);
if (isHmrOutputOlderThanSource(filepath, sourcePath)) {
appLogger.warn(
`[JsHmrStrategy] HMR output is older than source after rebuild; skipping broadcast for ${url}`
);
}
return { success: false, requiresReload: false };

@@ -207,0 +212,0 @@ }