vite-node 0.31.2 → 0.31.3

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.31.2";
27
+ var version = "0.31.3";
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:path';
17
17
  import 'node:vm';
18
18
  import 'node:events';
19
19
 
20
- var version = "0.31.2";
20
+ var version = "0.31.3";
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/client.cjs CHANGED
@@ -112,10 +112,12 @@ class ModuleCacheMap extends Map {
112
112
  return this.deleteByModuleId(this.normalizePath(fsPath));
113
113
  }
114
114
  invalidateModule(mod) {
115
+ var _a;
115
116
  delete mod.evaluated;
116
117
  delete mod.resolving;
117
118
  delete mod.promise;
118
119
  delete mod.exports;
120
+ (_a = mod.importers) == null ? void 0 : _a.clear();
119
121
  return true;
120
122
  }
121
123
  /**
@@ -195,7 +197,7 @@ ${[...callstack, fsPath].reverse().map((p) => ` - ${p}`).join("\n")}`;
195
197
  if (callstack.includes(fsPath) || callstack.some((c) => {
196
198
  var _a;
197
199
  return (_a = this.moduleCache.get(c).importers) == null ? void 0 : _a.has(fsPath);
198
- }) || mod.importers.has(importee)) {
200
+ })) {
199
201
  if (mod.exports)
200
202
  return mod.exports;
201
203
  }
package/dist/client.mjs CHANGED
@@ -85,10 +85,12 @@ class ModuleCacheMap extends Map {
85
85
  return this.deleteByModuleId(this.normalizePath(fsPath));
86
86
  }
87
87
  invalidateModule(mod) {
88
+ var _a;
88
89
  delete mod.evaluated;
89
90
  delete mod.resolving;
90
91
  delete mod.promise;
91
92
  delete mod.exports;
93
+ (_a = mod.importers) == null ? void 0 : _a.clear();
92
94
  return true;
93
95
  }
94
96
  /**
@@ -168,7 +170,7 @@ ${[...callstack, fsPath].reverse().map((p) => ` - ${p}`).join("\n")}`;
168
170
  if (callstack.includes(fsPath) || callstack.some((c) => {
169
171
  var _a;
170
172
  return (_a = this.moduleCache.get(c).importers) == null ? void 0 : _a.has(fsPath);
171
- }) || mod.importers.has(importee)) {
173
+ })) {
172
174
  if (mod.exports)
173
175
  return mod.exports;
174
176
  }
package/dist/server.cjs CHANGED
@@ -221,7 +221,7 @@ class ViteNodeServer {
221
221
  this.existingOptimizedDeps = /* @__PURE__ */ new Set();
222
222
  this.fetchCache = /* @__PURE__ */ new Map();
223
223
  this.externalizeCache = /* @__PURE__ */ new Map();
224
- var _a, _b, _c, _d;
224
+ var _a, _b, _c;
225
225
  const ssrOptions = server.config.ssr;
226
226
  options.deps ?? (options.deps = {});
227
227
  options.deps.cacheDir = pathe.relative(server.config.root, server.config.cacheDir);
@@ -242,7 +242,8 @@ class ViteNodeServer {
242
242
  if (options.debug)
243
243
  this.debugger = new Debugger(server.config.root, options.debug);
244
244
  (_c = options.deps).moduleDirectories ?? (_c.moduleDirectories = []);
245
- const customModuleDirectories = (_d = process.env.VITE_NODE_DEPS_MODULE_DIRECTORIES) == null ? void 0 : _d.split(",");
245
+ const envValue = process.env.VITE_NODE_DEPS_MODULE_DIRECTORIES || process.env.npm_config_VITE_NODE_DEPS_MODULE_DIRECTORIES;
246
+ const customModuleDirectories = envValue == null ? void 0 : envValue.split(",");
246
247
  if (customModuleDirectories)
247
248
  options.deps.moduleDirectories.push(...customModuleDirectories);
248
249
  }
package/dist/server.mjs CHANGED
@@ -212,7 +212,7 @@ class ViteNodeServer {
212
212
  this.existingOptimizedDeps = /* @__PURE__ */ new Set();
213
213
  this.fetchCache = /* @__PURE__ */ new Map();
214
214
  this.externalizeCache = /* @__PURE__ */ new Map();
215
- var _a, _b, _c, _d;
215
+ var _a, _b, _c;
216
216
  const ssrOptions = server.config.ssr;
217
217
  options.deps ?? (options.deps = {});
218
218
  options.deps.cacheDir = relative(server.config.root, server.config.cacheDir);
@@ -233,7 +233,8 @@ class ViteNodeServer {
233
233
  if (options.debug)
234
234
  this.debugger = new Debugger(server.config.root, options.debug);
235
235
  (_c = options.deps).moduleDirectories ?? (_c.moduleDirectories = []);
236
- const customModuleDirectories = (_d = process.env.VITE_NODE_DEPS_MODULE_DIRECTORIES) == null ? void 0 : _d.split(",");
236
+ const envValue = process.env.VITE_NODE_DEPS_MODULE_DIRECTORIES || process.env.npm_config_VITE_NODE_DEPS_MODULE_DIRECTORIES;
237
+ const customModuleDirectories = envValue == null ? void 0 : envValue.split(",");
237
238
  if (customModuleDirectories)
238
239
  options.deps.moduleDirectories.push(...customModuleDirectories);
239
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.31.2",
3
+ "version": "0.31.3",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",