vite-node 1.3.0 → 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/LICENSE CHANGED
@@ -1,7 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021-Present Anthony Fu <https://github.com/antfu>
4
- Copyright (c) 2021-Present Matias Capeletto <https://github.com/patak-dev>
3
+ Copyright (c) 2021-Present Vitest Team
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/cli.cjs CHANGED
@@ -7,8 +7,8 @@ var vite = require('vite');
7
7
  var server = require('./server.cjs');
8
8
  var client = require('./client.cjs');
9
9
  var utils = require('./utils.cjs');
10
- var hmr = require('./chunk-hmr.cjs');
11
10
  var sourceMap = require('./source-map.cjs');
11
+ var hmr = require('./chunk-hmr.cjs');
12
12
  require('node:perf_hooks');
13
13
  require('node:fs');
14
14
  require('node:assert');
@@ -20,7 +20,7 @@ require('node:url');
20
20
  require('node:vm');
21
21
  require('node:events');
22
22
 
23
- var version = "1.3.0";
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.0";
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.0",
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",