vite-node 0.29.0 → 0.29.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 CHANGED
@@ -24,7 +24,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
24
24
  var cac__default = /*#__PURE__*/_interopDefaultLegacy(cac);
25
25
  var c__default = /*#__PURE__*/_interopDefaultLegacy(c);
26
26
 
27
- var version = "0.29.0";
27
+ var version = "0.29.2";
28
28
 
29
29
  const cli = cac__default["default"]("vite-node");
30
30
  cli.version(version).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").help();
package/dist/cli.mjs CHANGED
@@ -17,7 +17,7 @@ import 'node:module';
17
17
  import 'node:vm';
18
18
  import 'node:events';
19
19
 
20
- var version = "0.29.0";
20
+ var version = "0.29.2";
21
21
 
22
22
  const cli = cac("vite-node");
23
23
  cli.version(version).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").help();
package/dist/server.cjs CHANGED
@@ -307,8 +307,9 @@ class ViteNodeServer {
307
307
  var _a, _b;
308
308
  let result;
309
309
  const cacheDir = (_a = this.options.deps) == null ? void 0 : _a.cacheDir;
310
- if (cacheDir && id.includes(cacheDir) && !id.includes(this.server.config.root)) {
311
- id = pathe.join(this.server.config.root, id);
310
+ if (cacheDir && id.includes(cacheDir)) {
311
+ if (!id.startsWith(this.server.config.root))
312
+ id = pathe.join(this.server.config.root, id);
312
313
  const timeout = setTimeout(() => {
313
314
  throw new Error(`ViteNodeServer: ${id} not found. This is a bug, please report it.`);
314
315
  }, 5e3);
package/dist/server.mjs CHANGED
@@ -298,8 +298,9 @@ class ViteNodeServer {
298
298
  var _a, _b;
299
299
  let result;
300
300
  const cacheDir = (_a = this.options.deps) == null ? void 0 : _a.cacheDir;
301
- if (cacheDir && id.includes(cacheDir) && !id.includes(this.server.config.root)) {
302
- id = join(this.server.config.root, id);
301
+ if (cacheDir && id.includes(cacheDir)) {
302
+ if (!id.startsWith(this.server.config.root))
303
+ id = join(this.server.config.root, id);
303
304
  const timeout = setTimeout(() => {
304
305
  throw new Error(`ViteNodeServer: ${id} not found. This is a bug, please report it.`);
305
306
  }, 5e3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.29.0",
3
+ "version": "0.29.2",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",