vite-node 0.27.2 → 0.28.0

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
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
25
25
  var cac__default = /*#__PURE__*/_interopDefaultLegacy(cac);
26
26
  var c__default = /*#__PURE__*/_interopDefaultLegacy(c);
27
27
 
28
- var version = "0.27.2";
28
+ var version = "0.28.0";
29
29
 
30
30
  const cli = cac__default["default"]("vite-node");
31
31
  cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
package/dist/cli.mjs CHANGED
@@ -18,7 +18,7 @@ import 'node:path';
18
18
  import 'node:vm';
19
19
  import 'node:events';
20
20
 
21
- var version = "0.27.2";
21
+ var version = "0.28.0";
22
22
 
23
23
  const cli = cac("vite-node");
24
24
  cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
package/dist/client.cjs CHANGED
@@ -37,6 +37,7 @@ function _interopNamespace(e) {
37
37
  var vm__default = /*#__PURE__*/_interopDefaultLegacy(vm);
38
38
  var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
39
39
 
40
+ const { setTimeout, clearTimeout } = globalThis;
40
41
  const debugExecute = createDebug__default["default"]("vite-node:client:execute");
41
42
  const debugNative = createDebug__default["default"]("vite-node:client:native");
42
43
  const clientStub = {
@@ -188,11 +189,13 @@ class ViteNodeRunner {
188
189
  return !utils.isInternalRequest(id) && !mlly.isNodeBuiltin(id);
189
190
  }
190
191
  async _resolveUrl(id, importee) {
191
- if (!this.shouldResolveId(id))
192
- return [id, id];
193
192
  if (importee && id.startsWith(utils.VALID_ID_PREFIX))
194
193
  importee = void 0;
195
194
  id = utils.normalizeRequestId(id, this.options.base);
195
+ if (!id.startsWith("/") && !id.startsWith("./") && !id.startsWith("../"))
196
+ importee = void 0;
197
+ if (!this.shouldResolveId(id))
198
+ return [id, id];
196
199
  const { path, exists } = utils.toFilePath(id, this.root);
197
200
  if (!this.options.resolveId || exists)
198
201
  return [id, path];
package/dist/client.mjs CHANGED
@@ -10,6 +10,7 @@ import { extractSourceMap } from './source-map.mjs';
10
10
  import 'node:fs';
11
11
  import 'source-map-support';
12
12
 
13
+ const { setTimeout, clearTimeout } = globalThis;
13
14
  const debugExecute = createDebug("vite-node:client:execute");
14
15
  const debugNative = createDebug("vite-node:client:native");
15
16
  const clientStub = {
@@ -161,11 +162,13 @@ class ViteNodeRunner {
161
162
  return !isInternalRequest(id) && !isNodeBuiltin(id);
162
163
  }
163
164
  async _resolveUrl(id, importee) {
164
- if (!this.shouldResolveId(id))
165
- return [id, id];
166
165
  if (importee && id.startsWith(VALID_ID_PREFIX))
167
166
  importee = void 0;
168
167
  id = normalizeRequestId(id, this.options.base);
168
+ if (!id.startsWith("/") && !id.startsWith("./") && !id.startsWith("../"))
169
+ importee = void 0;
170
+ if (!this.shouldResolveId(id))
171
+ return [id, id];
169
172
  const { path, exists } = toFilePath(id, this.root);
170
173
  if (!this.options.resolveId || exists)
171
174
  return [id, path];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.27.2",
3
+ "version": "0.28.0",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -73,7 +73,7 @@
73
73
  "cac": "^6.7.14",
74
74
  "debug": "^4.3.4",
75
75
  "mlly": "^1.1.0",
76
- "pathe": "^0.2.0",
76
+ "pathe": "^1.1.0",
77
77
  "picocolors": "^1.0.0",
78
78
  "source-map": "^0.6.1",
79
79
  "source-map-support": "^0.5.21",