vite-node 1.1.0 → 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/client.cjs +6 -2
- package/dist/client.mjs +6 -2
- 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/client.cjs
CHANGED
|
@@ -268,6 +268,8 @@ ${getStack()}`), 2e3);
|
|
|
268
268
|
enumerable: false,
|
|
269
269
|
configurable: false
|
|
270
270
|
});
|
|
271
|
+
const SYMBOL_NOT_DEFINED = Symbol2("not defined");
|
|
272
|
+
let moduleExports = SYMBOL_NOT_DEFINED;
|
|
271
273
|
const cjsExports = new Proxy(exports, {
|
|
272
274
|
get: (target, p, receiver) => {
|
|
273
275
|
if (Reflect2.has(target, p))
|
|
@@ -283,11 +285,12 @@ ${getStack()}`), 2e3);
|
|
|
283
285
|
}
|
|
284
286
|
if (!Reflect2.has(exports, "default"))
|
|
285
287
|
exports.default = {};
|
|
286
|
-
if (utils.isPrimitive(
|
|
288
|
+
if (moduleExports !== SYMBOL_NOT_DEFINED && utils.isPrimitive(moduleExports)) {
|
|
287
289
|
defineExport(exports, p, () => void 0);
|
|
288
290
|
return true;
|
|
289
291
|
}
|
|
290
|
-
exports.default
|
|
292
|
+
if (!utils.isPrimitive(exports.default))
|
|
293
|
+
exports.default[p] = value;
|
|
291
294
|
if (p !== "default")
|
|
292
295
|
defineExport(exports, p, () => value);
|
|
293
296
|
return true;
|
|
@@ -299,6 +302,7 @@ ${getStack()}`), 2e3);
|
|
|
299
302
|
set exports(value) {
|
|
300
303
|
exportAll(cjsExports, value);
|
|
301
304
|
exports.default = value;
|
|
305
|
+
moduleExports = value;
|
|
302
306
|
},
|
|
303
307
|
get exports() {
|
|
304
308
|
return cjsExports;
|
package/dist/client.mjs
CHANGED
|
@@ -266,6 +266,8 @@ ${getStack()}`), 2e3);
|
|
|
266
266
|
enumerable: false,
|
|
267
267
|
configurable: false
|
|
268
268
|
});
|
|
269
|
+
const SYMBOL_NOT_DEFINED = Symbol2("not defined");
|
|
270
|
+
let moduleExports = SYMBOL_NOT_DEFINED;
|
|
269
271
|
const cjsExports = new Proxy(exports, {
|
|
270
272
|
get: (target, p, receiver) => {
|
|
271
273
|
if (Reflect2.has(target, p))
|
|
@@ -281,11 +283,12 @@ ${getStack()}`), 2e3);
|
|
|
281
283
|
}
|
|
282
284
|
if (!Reflect2.has(exports, "default"))
|
|
283
285
|
exports.default = {};
|
|
284
|
-
if (isPrimitive(
|
|
286
|
+
if (moduleExports !== SYMBOL_NOT_DEFINED && isPrimitive(moduleExports)) {
|
|
285
287
|
defineExport(exports, p, () => void 0);
|
|
286
288
|
return true;
|
|
287
289
|
}
|
|
288
|
-
exports.default
|
|
290
|
+
if (!isPrimitive(exports.default))
|
|
291
|
+
exports.default[p] = value;
|
|
289
292
|
if (p !== "default")
|
|
290
293
|
defineExport(exports, p, () => value);
|
|
291
294
|
return true;
|
|
@@ -297,6 +300,7 @@ ${getStack()}`), 2e3);
|
|
|
297
300
|
set exports(value) {
|
|
298
301
|
exportAll(cjsExports, value);
|
|
299
302
|
exports.default = value;
|
|
303
|
+
moduleExports = value;
|
|
300
304
|
},
|
|
301
305
|
get exports() {
|
|
302
306
|
return cjsExports;
|
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);
|