vite-node 0.32.2 → 0.32.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.
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('fs');
13
13
  require('pathe');
@@ -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.32.2";
27
+ var version = "0.32.4";
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.32.2";
20
+ var version = "0.32.4";
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
@@ -184,6 +184,13 @@ class ViteNodeRunner {
184
184
  this.moduleCache = options.moduleCache ?? new ModuleCacheMap();
185
185
  this.debug = options.debug ?? (typeof process !== "undefined" ? !!process.env.VITE_NODE_DEBUG_RUNNER : false);
186
186
  }
187
+ root;
188
+ debug;
189
+ /**
190
+ * Holds the cache of modules
191
+ * Keys of the map are filepaths, or plain package names
192
+ */
193
+ moduleCache;
187
194
  async executeFile(file) {
188
195
  const url = `/@fs/${utils.slash(pathe.resolve(file))}`;
189
196
  return await this.cachedRequest(url, url, []);
package/dist/client.mjs CHANGED
@@ -157,6 +157,13 @@ class ViteNodeRunner {
157
157
  this.moduleCache = options.moduleCache ?? new ModuleCacheMap();
158
158
  this.debug = options.debug ?? (typeof process !== "undefined" ? !!process.env.VITE_NODE_DEBUG_RUNNER : false);
159
159
  }
160
+ root;
161
+ debug;
162
+ /**
163
+ * Holds the cache of modules
164
+ * Keys of the map are filepaths, or plain package names
165
+ */
166
+ moduleCache;
160
167
  async executeFile(file) {
161
168
  const url = `/@fs/${slash(resolve(file))}`;
162
169
  return await this.cachedRequest(url, url, []);
package/dist/server.cjs CHANGED
@@ -152,7 +152,6 @@ function hashCode(s) {
152
152
  class Debugger {
153
153
  constructor(root, options) {
154
154
  this.options = options;
155
- this.externalizeMap = /* @__PURE__ */ new Map();
156
155
  if (options.dumpModules)
157
156
  this.dumpDir = pathe.resolve(root, options.dumpModules === true ? ".vite-node/dump" : options.dumpModules);
158
157
  if (this.dumpDir) {
@@ -163,6 +162,9 @@ class Debugger {
163
162
  }
164
163
  this.initPromise = this.clearDump();
165
164
  }
165
+ dumpDir;
166
+ initPromise;
167
+ externalizeMap = /* @__PURE__ */ new Map();
166
168
  async clearDump() {
167
169
  if (!this.dumpDir)
168
170
  return;
@@ -217,11 +219,6 @@ class ViteNodeServer {
217
219
  constructor(server, options = {}) {
218
220
  this.server = server;
219
221
  this.options = options;
220
- this.fetchPromiseMap = /* @__PURE__ */ new Map();
221
- this.transformPromiseMap = /* @__PURE__ */ new Map();
222
- this.existingOptimizedDeps = /* @__PURE__ */ new Set();
223
- this.fetchCache = /* @__PURE__ */ new Map();
224
- this.externalizeCache = /* @__PURE__ */ new Map();
225
222
  var _a, _b, _c;
226
223
  const ssrOptions = server.config.ssr;
227
224
  options.deps ?? (options.deps = {});
@@ -248,6 +245,12 @@ class ViteNodeServer {
248
245
  if (customModuleDirectories)
249
246
  options.deps.moduleDirectories.push(...customModuleDirectories);
250
247
  }
248
+ fetchPromiseMap = /* @__PURE__ */ new Map();
249
+ transformPromiseMap = /* @__PURE__ */ new Map();
250
+ existingOptimizedDeps = /* @__PURE__ */ new Set();
251
+ fetchCache = /* @__PURE__ */ new Map();
252
+ externalizeCache = /* @__PURE__ */ new Map();
253
+ debugger;
251
254
  shouldExternalize(id) {
252
255
  return shouldExternalize(id, this.options.deps, this.externalizeCache);
253
256
  }
package/dist/server.mjs CHANGED
@@ -143,7 +143,6 @@ function hashCode(s) {
143
143
  class Debugger {
144
144
  constructor(root, options) {
145
145
  this.options = options;
146
- this.externalizeMap = /* @__PURE__ */ new Map();
147
146
  if (options.dumpModules)
148
147
  this.dumpDir = resolve(root, options.dumpModules === true ? ".vite-node/dump" : options.dumpModules);
149
148
  if (this.dumpDir) {
@@ -154,6 +153,9 @@ class Debugger {
154
153
  }
155
154
  this.initPromise = this.clearDump();
156
155
  }
156
+ dumpDir;
157
+ initPromise;
158
+ externalizeMap = /* @__PURE__ */ new Map();
157
159
  async clearDump() {
158
160
  if (!this.dumpDir)
159
161
  return;
@@ -208,11 +210,6 @@ class ViteNodeServer {
208
210
  constructor(server, options = {}) {
209
211
  this.server = server;
210
212
  this.options = options;
211
- this.fetchPromiseMap = /* @__PURE__ */ new Map();
212
- this.transformPromiseMap = /* @__PURE__ */ new Map();
213
- this.existingOptimizedDeps = /* @__PURE__ */ new Set();
214
- this.fetchCache = /* @__PURE__ */ new Map();
215
- this.externalizeCache = /* @__PURE__ */ new Map();
216
213
  var _a, _b, _c;
217
214
  const ssrOptions = server.config.ssr;
218
215
  options.deps ?? (options.deps = {});
@@ -239,6 +236,12 @@ class ViteNodeServer {
239
236
  if (customModuleDirectories)
240
237
  options.deps.moduleDirectories.push(...customModuleDirectories);
241
238
  }
239
+ fetchPromiseMap = /* @__PURE__ */ new Map();
240
+ transformPromiseMap = /* @__PURE__ */ new Map();
241
+ existingOptimizedDeps = /* @__PURE__ */ new Set();
242
+ fetchCache = /* @__PURE__ */ new Map();
243
+ externalizeCache = /* @__PURE__ */ new Map();
244
+ debugger;
242
245
  shouldExternalize(id) {
243
246
  return shouldExternalize(id, this.options.deps, this.externalizeCache);
244
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-node",
3
- "version": "0.32.2",
3
+ "version": "0.32.4",
4
4
  "description": "Vite as Node.js runtime",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -72,14 +72,14 @@
72
72
  "dependencies": {
73
73
  "cac": "^6.7.14",
74
74
  "debug": "^4.3.4",
75
- "mlly": "^1.2.0",
76
- "pathe": "^1.1.0",
75
+ "mlly": "^1.4.0",
76
+ "pathe": "^1.1.1",
77
77
  "picocolors": "^1.0.0",
78
78
  "vite": "^3.0.0 || ^4.0.0"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@jridgewell/trace-mapping": "^0.3.18",
82
- "@types/debug": "^4.1.7",
82
+ "@types/debug": "^4.1.8",
83
83
  "rollup": "^2.79.1"
84
84
  },
85
85
  "scripts": {