vite-node 1.3.1 → 1.4.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
@@ -20,7 +20,7 @@ require('node:url');
20
20
  require('node:vm');
21
21
  require('node:events');
22
22
 
23
- var version = "1.3.1";
23
+ var version = "1.4.0";
24
24
 
25
25
  const cli = cac("vite-node");
26
26
  cli.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").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
package/dist/cli.mjs CHANGED
@@ -18,7 +18,7 @@ import 'node:url';
18
18
  import 'node:vm';
19
19
  import 'node:events';
20
20
 
21
- var version = "1.3.1";
21
+ var version = "1.4.0";
22
22
 
23
23
  const cli = cac("vite-node");
24
24
  cli.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").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
@@ -881,6 +881,8 @@ function withInlineSourcemap(result, options) {
881
881
  const OTHER_SOURCE_MAP_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json[^,]+base64,([A-Za-z0-9+/=]+)$`, "gm");
882
882
  while (OTHER_SOURCE_MAP_REGEXP.test(code))
883
883
  code = code.replace(OTHER_SOURCE_MAP_REGEXP, "");
884
+ if (map.mappings.startsWith(";"))
885
+ map.mappings = `AAAA,CAAA${map.mappings}`;
884
886
  const sourceMap = Buffer.from(JSON.stringify(map), "utf-8").toString("base64");
885
887
  result.code = `${code.trimEnd()}
886
888
 
@@ -879,6 +879,8 @@ function withInlineSourcemap(result, options) {
879
879
  const OTHER_SOURCE_MAP_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json[^,]+base64,([A-Za-z0-9+/=]+)$`, "gm");
880
880
  while (OTHER_SOURCE_MAP_REGEXP.test(code))
881
881
  code = code.replace(OTHER_SOURCE_MAP_REGEXP, "");
882
+ if (map.mappings.startsWith(";"))
883
+ map.mappings = `AAAA,CAAA${map.mappings}`;
882
884
  const sourceMap = Buffer.from(JSON.stringify(map), "utf-8").toString("base64");
883
885
  result.code = `${code.trimEnd()}
884
886
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-node",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.4.0",
5
5
  "description": "Vite as Node.js runtime",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",