vite-node 1.1.1 → 1.1.2
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/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/server.cjs +3 -3
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -20,7 +20,7 @@ require('node:url');
|
|
|
20
20
|
require('node:vm');
|
|
21
21
|
require('node:events');
|
|
22
22
|
|
|
23
|
-
var version = "1.1.
|
|
23
|
+
var version = "1.1.2";
|
|
24
24
|
|
|
25
25
|
const cli = cac("vite-node");
|
|
26
26
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
package/dist/cli.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import 'node:url';
|
|
|
18
18
|
import 'node:vm';
|
|
19
19
|
import 'node:events';
|
|
20
20
|
|
|
21
|
-
var version = "1.1.
|
|
21
|
+
var version = "1.1.2";
|
|
22
22
|
|
|
23
23
|
const cli = cac("vite-node");
|
|
24
24
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
package/dist/server.cjs
CHANGED
|
@@ -345,10 +345,10 @@ class ViteNodeServer {
|
|
|
345
345
|
clearTimeout(timeout);
|
|
346
346
|
}
|
|
347
347
|
const { path: filePath } = utils.toFilePath(id, this.server.config.root);
|
|
348
|
-
const
|
|
349
|
-
const timestamp = module ? module.lastHMRTimestamp : null;
|
|
348
|
+
const moduleNode = this.server.moduleGraph.getModuleById(id) || this.server.moduleGraph.getModuleById(filePath);
|
|
350
349
|
const cache = this.fetchCaches[transformMode].get(filePath);
|
|
351
|
-
|
|
350
|
+
const timestamp = moduleNode ? Math.max(moduleNode.lastHMRTimestamp, moduleNode.lastInvalidationTimestamp) : 0;
|
|
351
|
+
if (cache && (timestamp === 0 || cache.timestamp >= timestamp))
|
|
352
352
|
return cache.result;
|
|
353
353
|
const time = Date.now();
|
|
354
354
|
const externalize = await this.shouldExternalize(filePath);
|
package/dist/server.mjs
CHANGED
|
@@ -343,10 +343,10 @@ class ViteNodeServer {
|
|
|
343
343
|
clearTimeout(timeout);
|
|
344
344
|
}
|
|
345
345
|
const { path: filePath } = toFilePath(id, this.server.config.root);
|
|
346
|
-
const
|
|
347
|
-
const timestamp = module ? module.lastHMRTimestamp : null;
|
|
346
|
+
const moduleNode = this.server.moduleGraph.getModuleById(id) || this.server.moduleGraph.getModuleById(filePath);
|
|
348
347
|
const cache = this.fetchCaches[transformMode].get(filePath);
|
|
349
|
-
|
|
348
|
+
const timestamp = moduleNode ? Math.max(moduleNode.lastHMRTimestamp, moduleNode.lastInvalidationTimestamp) : 0;
|
|
349
|
+
if (cache && (timestamp === 0 || cache.timestamp >= timestamp))
|
|
350
350
|
return cache.result;
|
|
351
351
|
const time = Date.now();
|
|
352
352
|
const externalize = await this.shouldExternalize(filePath);
|