vite-node 0.15.2 → 0.16.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/chunk-utils.cjs +2 -2
- package/dist/chunk-utils.mjs +3 -3
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/package.json +1 -1
package/dist/chunk-utils.cjs
CHANGED
|
@@ -13,7 +13,7 @@ function mergeSlashes(str) {
|
|
|
13
13
|
function normalizeRequestId(id, base) {
|
|
14
14
|
if (base && id.startsWith(base))
|
|
15
15
|
id = `/${id.slice(base.length)}`;
|
|
16
|
-
return id.replace(/^\/@id\/__x00__/, "\0").replace(/^\/@id\//, "").replace(/^__vite-browser-external:/, "").replace(/^(node|file):/, "").replace(/^\/+/, "/").replace(/\?v=\w+/, "?").replace(/&v=\w+/, "").replace(/\?t=\w+/, "?").replace(/&t=\w+/, "").replace(/\?import/, "?").replace(/&import/, "").replace(/\?+$/, "");
|
|
16
|
+
return id.replace(/^\/@id\/__x00__/, "\0").replace(/^\/@id\//, "").replace(/^__vite-browser-external:/, "").replace(/^(node|file):/, "").replace(/^\/+/, "/").replace(/\?v=\w+/, "?").replace(/&v=\w+/, "").replace(/\?t=\w+/, "?").replace(/&t=\w+/, "").replace(/\?import/, "?").replace(/&import/, "").replace(/\?&/, "?").replace(/\?+$/, "");
|
|
17
17
|
}
|
|
18
18
|
function normalizeModuleId(id) {
|
|
19
19
|
return id.replace(/\\/g, "/").replace(/^\/@fs\//, "/").replace(/^file:\//, "/").replace(/^\/+/, "/");
|
|
@@ -22,7 +22,7 @@ function isPrimitive(v) {
|
|
|
22
22
|
return v !== Object(v);
|
|
23
23
|
}
|
|
24
24
|
function toFilePath(id, root) {
|
|
25
|
-
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(
|
|
25
|
+
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(root) ? id : id.startsWith("/") ? slash(pathe.resolve(root, id.slice(1))) : id;
|
|
26
26
|
if (absolute.startsWith("//"))
|
|
27
27
|
absolute = absolute.slice(1);
|
|
28
28
|
return isWindows && absolute.startsWith("/") ? url.fileURLToPath(url.pathToFileURL(absolute.slice(1)).href) : absolute;
|
package/dist/chunk-utils.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
2
|
-
import {
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
3
|
|
|
4
4
|
const isWindows = process.platform === "win32";
|
|
5
5
|
function slash(str) {
|
|
@@ -11,7 +11,7 @@ function mergeSlashes(str) {
|
|
|
11
11
|
function normalizeRequestId(id, base) {
|
|
12
12
|
if (base && id.startsWith(base))
|
|
13
13
|
id = `/${id.slice(base.length)}`;
|
|
14
|
-
return id.replace(/^\/@id\/__x00__/, "\0").replace(/^\/@id\//, "").replace(/^__vite-browser-external:/, "").replace(/^(node|file):/, "").replace(/^\/+/, "/").replace(/\?v=\w+/, "?").replace(/&v=\w+/, "").replace(/\?t=\w+/, "?").replace(/&t=\w+/, "").replace(/\?import/, "?").replace(/&import/, "").replace(/\?+$/, "");
|
|
14
|
+
return id.replace(/^\/@id\/__x00__/, "\0").replace(/^\/@id\//, "").replace(/^__vite-browser-external:/, "").replace(/^(node|file):/, "").replace(/^\/+/, "/").replace(/\?v=\w+/, "?").replace(/&v=\w+/, "").replace(/\?t=\w+/, "?").replace(/&t=\w+/, "").replace(/\?import/, "?").replace(/&import/, "").replace(/\?&/, "?").replace(/\?+$/, "");
|
|
15
15
|
}
|
|
16
16
|
function normalizeModuleId(id) {
|
|
17
17
|
return id.replace(/\\/g, "/").replace(/^\/@fs\//, "/").replace(/^file:\//, "/").replace(/^\/+/, "/");
|
|
@@ -20,7 +20,7 @@ function isPrimitive(v) {
|
|
|
20
20
|
return v !== Object(v);
|
|
21
21
|
}
|
|
22
22
|
function toFilePath(id, root) {
|
|
23
|
-
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(
|
|
23
|
+
let absolute = slash(id).startsWith("/@fs/") ? id.slice(4) : id.startsWith(root) ? id : id.startsWith("/") ? slash(resolve(root, id.slice(1))) : id;
|
|
24
24
|
if (absolute.startsWith("//"))
|
|
25
25
|
absolute = absolute.slice(1);
|
|
26
26
|
return isWindows && absolute.startsWith("/") ? fileURLToPath(pathToFileURL(absolute.slice(1)).href) : absolute;
|
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED