vite-node 0.28.3 → 0.28.4

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.
@@ -148,6 +148,7 @@ async function handleMessage(runner, emitter, files, payload) {
148
148
  break;
149
149
  case "full-reload":
150
150
  notifyListeners(runner, "vite:beforeFullReload", payload);
151
+ maps.customListenersMap.delete("vite:beforeFullReload");
151
152
  reload(runner, files);
152
153
  break;
153
154
  case "prune":
@@ -141,6 +141,7 @@ async function handleMessage(runner, emitter, files, payload) {
141
141
  break;
142
142
  case "full-reload":
143
143
  notifyListeners(runner, "vite:beforeFullReload", payload);
144
+ maps.customListenersMap.delete("vite:beforeFullReload");
144
145
  reload(runner, files);
145
146
  break;
146
147
  case "prune":
package/dist/cli.cjs CHANGED
@@ -6,8 +6,8 @@ var vite = require('vite');
6
6
  var server = require('./server.cjs');
7
7
  var client = require('./client.cjs');
8
8
  var utils = require('./utils.cjs');
9
- var sourceMap = require('./source-map.cjs');
10
9
  var hmr = require('./chunk-hmr.cjs');
10
+ var sourceMap = require('./source-map.cjs');
11
11
  require('perf_hooks');
12
12
  require('pathe');
13
13
  require('debug');
@@ -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.28.3";
28
+ var version = "0.28.4";
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.28.3";
21
+ var version = "0.28.4";
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
@@ -192,8 +192,6 @@ class ViteNodeRunner {
192
192
  if (importee && id.startsWith(utils.VALID_ID_PREFIX))
193
193
  importee = void 0;
194
194
  id = utils.normalizeRequestId(id, this.options.base);
195
- if (!id.startsWith("/") && !id.startsWith("./") && !id.startsWith("../"))
196
- importee = void 0;
197
195
  if (!this.shouldResolveId(id))
198
196
  return [id, id];
199
197
  const { path, exists } = utils.toFilePath(id, this.root);
@@ -266,6 +264,12 @@ ${getStack()}`), 2e3);
266
264
  configurable: false
267
265
  });
268
266
  const cjsExports = new Proxy(exports, {
267
+ get: (target, p, receiver) => {
268
+ if (Reflect.has(target, p))
269
+ return Reflect.get(target, p, receiver);
270
+ return Reflect.get(Object.prototype, p, receiver);
271
+ },
272
+ getPrototypeOf: () => Object.prototype,
269
273
  set: (_, p, value) => {
270
274
  if (p === "default" && this.shouldInterop(modulePath, { default: value })) {
271
275
  exportAll(cjsExports, value);
package/dist/client.mjs CHANGED
@@ -165,8 +165,6 @@ class ViteNodeRunner {
165
165
  if (importee && id.startsWith(VALID_ID_PREFIX))
166
166
  importee = void 0;
167
167
  id = normalizeRequestId(id, this.options.base);
168
- if (!id.startsWith("/") && !id.startsWith("./") && !id.startsWith("../"))
169
- importee = void 0;
170
168
  if (!this.shouldResolveId(id))
171
169
  return [id, id];
172
170
  const { path, exists } = toFilePath(id, this.root);
@@ -239,6 +237,12 @@ ${getStack()}`), 2e3);
239
237
  configurable: false
240
238
  });
241
239
  const cjsExports = new Proxy(exports, {
240
+ get: (target, p, receiver) => {
241
+ if (Reflect.has(target, p))
242
+ return Reflect.get(target, p, receiver);
243
+ return Reflect.get(Object.prototype, p, receiver);
244
+ },
245
+ getPrototypeOf: () => Object.prototype,
242
246
  set: (_, p, value) => {
243
247
  if (p === "default" && this.shouldInterop(modulePath, { default: value })) {
244
248
  exportAll(cjsExports, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.28.3",
3
+ "version": "0.28.4",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",