@coderline/alphatab-vite 1.8.1 → 1.8.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/AlphaTabVitePluginOptions.cjs +34 -37
- package/dist/AlphaTabVitePluginOptions.mjs +34 -35
- package/dist/alphaTab.vite.cjs +37 -44
- package/dist/alphaTab.vite.mjs +36 -36
- package/dist/alphaTabVitePlugin.cjs +50 -54
- package/dist/alphaTabVitePlugin.mjs +49 -50
- package/dist/bridge/asset.cjs +50 -80
- package/dist/bridge/asset.mjs +47 -57
- package/dist/bridge/build.cjs +152 -214
- package/dist/bridge/build.mjs +149 -191
- package/dist/bridge/bundler.cjs +54 -0
- package/dist/bridge/bundler.mjs +52 -0
- package/dist/bridge/config.cjs +34 -37
- package/dist/bridge/config.mjs +34 -35
- package/dist/bridge/constants.cjs +73 -80
- package/dist/bridge/constants.mjs +72 -76
- package/dist/bridge/fsUtils.cjs +46 -55
- package/dist/bridge/fsUtils.mjs +43 -51
- package/dist/bridge/index.cjs +58 -68
- package/dist/bridge/index.mjs +42 -42
- package/dist/bridge/optimizer.cjs +112 -155
- package/dist/bridge/optimizer.mjs +108 -132
- package/dist/bridge/plugins.cjs +39 -45
- package/dist/bridge/plugins.mjs +38 -41
- package/dist/bridge/resolve.cjs +54 -66
- package/dist/bridge/resolve.mjs +53 -62
- package/dist/bridge/typeUtils.cjs +34 -37
- package/dist/bridge/typeUtils.mjs +34 -35
- package/dist/bridge/utils.cjs +87 -121
- package/dist/bridge/utils.mjs +84 -117
- package/dist/bridge/worker.cjs +179 -183
- package/dist/bridge/worker.mjs +175 -160
- package/dist/chunk.cjs +63 -0
- package/dist/copyAssetsPlugin.cjs +102 -163
- package/dist/copyAssetsPlugin.mjs +35 -141
- package/dist/copyAssetsPlugin2.mjs +108 -0
- package/dist/detectionGlobalPlugin.cjs +65 -68
- package/dist/detectionGlobalPlugin.mjs +62 -64
- package/dist/dist.cjs +6595 -0
- package/dist/dist.mjs +6589 -0
- package/dist/importMetaPlugin.cjs +147 -192
- package/dist/importMetaPlugin.mjs +143 -188
- package/dist/prompt-DewH0PjV.cjs +885 -0
- package/dist/prompt-DewH0PjV.mjs +882 -0
- package/dist/workerPlugin.cjs +145 -219
- package/dist/workerPlugin.mjs +141 -196
- package/package.json +17 -17
package/dist/bridge/resolve.mjs
CHANGED
|
@@ -1,71 +1,62 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// index.ts for more details on contents and license of this file
|
|
42
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/resolve.ts#L534
|
|
2
|
+
* alphaTab Vite Plugin v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
import { cleanUrl } from "./utils.mjs";
|
|
37
|
+
import { tryResolveRealFile } from "./fsUtils.mjs";
|
|
38
|
+
import { normalizePath } from "vite";
|
|
39
|
+
//#region src/bridge/resolve.ts
|
|
43
40
|
function splitFileAndPostfix(path) {
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const file = cleanUrl(path);
|
|
42
|
+
return {
|
|
43
|
+
file,
|
|
44
|
+
postfix: path.slice(file.length)
|
|
45
|
+
};
|
|
46
46
|
}
|
|
47
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/resolve.ts#L566-L574
|
|
48
47
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
51
50
|
function tryFsResolve(fsPath, preserveSymlinks) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return res + postfix;
|
|
56
|
-
}
|
|
57
|
-
return;
|
|
51
|
+
const { file, postfix } = splitFileAndPostfix(fsPath);
|
|
52
|
+
const res = tryCleanFsResolve(file, preserveSymlinks);
|
|
53
|
+
if (res) return res + postfix;
|
|
58
54
|
}
|
|
59
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/resolve.ts#L580
|
|
60
55
|
function tryCleanFsResolve(file, preserveSymlinks) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (!normalizedResolved) {
|
|
66
|
-
return tryResolveRealFile(file, preserveSymlinks);
|
|
67
|
-
}
|
|
68
|
-
return normalizedResolved;
|
|
56
|
+
if (file.includes("node_modules")) return tryResolveRealFile(file, preserveSymlinks);
|
|
57
|
+
const normalizedResolved = tryResolveRealFile(normalizePath(file));
|
|
58
|
+
if (!normalizedResolved) return tryResolveRealFile(file, preserveSymlinks);
|
|
59
|
+
return normalizedResolved;
|
|
69
60
|
}
|
|
70
|
-
|
|
61
|
+
//#endregion
|
|
71
62
|
export { tryFsResolve };
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'use strict';
|
|
38
|
-
|
|
2
|
+
* alphaTab Vite Plugin v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
* alphaTab Vite Plugin v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
package/dist/bridge/utils.cjs
CHANGED
|
@@ -1,157 +1,123 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const node_crypto = require('node:crypto');
|
|
43
|
-
|
|
44
|
-
// index.ts for more details on contents and license of this file
|
|
45
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1302
|
|
2
|
+
* alphaTab Vite Plugin v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
37
|
+
const require_chunk = require("../chunk.cjs");
|
|
38
|
+
let node_fs = require("node:fs");
|
|
39
|
+
node_fs = require_chunk.__toESM(node_fs, 1);
|
|
40
|
+
let node_crypto = require("node:crypto");
|
|
41
|
+
//#region src/bridge/utils.ts
|
|
46
42
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
49
45
|
function evalValue(rawValue) {
|
|
50
|
-
|
|
46
|
+
return new Function(`
|
|
51
47
|
var console, exports, global, module, process, require
|
|
52
48
|
return (\n${rawValue}\n)
|
|
53
|
-
`);
|
|
54
|
-
return fn();
|
|
49
|
+
`)();
|
|
55
50
|
}
|
|
56
|
-
|
|
57
|
-
const postfixRE = /[?#].*$/;
|
|
51
|
+
var postfixRE = /[?#].*$/;
|
|
58
52
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
61
55
|
function cleanUrl(url) {
|
|
62
|
-
|
|
56
|
+
return url.replace(postfixRE, "");
|
|
63
57
|
}
|
|
64
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L393
|
|
65
58
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
68
61
|
function tryStatSync(file) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
// Ignore errors
|
|
75
|
-
}
|
|
76
|
-
return;
|
|
62
|
+
try {
|
|
63
|
+
return node_fs.default.statSync(file, { throwIfNoEntry: false });
|
|
64
|
+
} catch {}
|
|
77
65
|
}
|
|
78
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1030
|
|
79
66
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
82
69
|
function getHash(text, length = 8) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
return h.padEnd(length, '_');
|
|
70
|
+
const h = (0, node_crypto.createHash)("sha256").update(text).digest("hex").substring(0, length);
|
|
71
|
+
if (length <= 64) return h;
|
|
72
|
+
return h.padEnd(length, "_");
|
|
88
73
|
}
|
|
89
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/shared/utils.ts#L40
|
|
90
74
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
93
77
|
function withTrailingSlash(path) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
return path;
|
|
78
|
+
if (path[path.length - 1] !== "/") return `${path}/`;
|
|
79
|
+
return path;
|
|
98
80
|
}
|
|
99
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1268
|
|
100
81
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
103
84
|
function joinUrlSegments(a, b) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
a = a.substring(0, a.length - 1);
|
|
109
|
-
}
|
|
110
|
-
if (b[0] !== '/') {
|
|
111
|
-
b = `/${b}`;
|
|
112
|
-
}
|
|
113
|
-
return a + b;
|
|
85
|
+
if (!a || !b) return a || b || "";
|
|
86
|
+
if (a[a.length - 1] === "/") a = a.substring(0, a.length - 1);
|
|
87
|
+
if (b[0] !== "/") b = `/${b}`;
|
|
88
|
+
return a + b;
|
|
114
89
|
}
|
|
115
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1281
|
|
116
90
|
/**
|
|
117
|
-
|
|
118
|
-
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
119
93
|
function removeLeadingSlash(str) {
|
|
120
|
-
|
|
94
|
+
return str[0] === "/" ? str.slice(1) : str;
|
|
121
95
|
}
|
|
122
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L319
|
|
123
96
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
126
99
|
function injectQuery(builtUrl, query) {
|
|
127
|
-
|
|
128
|
-
return builtUrl + (queryIndex === -1 ? '?' : '&') + query;
|
|
100
|
+
return builtUrl + (builtUrl.indexOf("?") === -1 ? "?" : "&") + query;
|
|
129
101
|
}
|
|
130
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1435
|
|
131
102
|
/**
|
|
132
|
-
|
|
133
|
-
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
134
105
|
function partialEncodeURIPath(uri) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const postfix = filePath !== uri ? uri.slice(filePath.length) : '';
|
|
140
|
-
return filePath.replaceAll('%', '%25') + postfix;
|
|
106
|
+
if (uri.startsWith("data:")) return uri;
|
|
107
|
+
const filePath = cleanUrl(uri);
|
|
108
|
+
const postfix = filePath !== uri ? uri.slice(filePath.length) : "";
|
|
109
|
+
return filePath.replaceAll("%", "%25") + postfix;
|
|
141
110
|
}
|
|
142
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/utils.ts#L1424
|
|
143
111
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
146
114
|
function encodeURIPath(uri) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const postfix = filePath !== uri ? uri.slice(filePath.length) : '';
|
|
152
|
-
return encodeURI(filePath) + postfix;
|
|
115
|
+
if (uri.startsWith("data:")) return uri;
|
|
116
|
+
const filePath = cleanUrl(uri);
|
|
117
|
+
const postfix = filePath !== uri ? uri.slice(filePath.length) : "";
|
|
118
|
+
return encodeURI(filePath) + postfix;
|
|
153
119
|
}
|
|
154
|
-
|
|
120
|
+
//#endregion
|
|
155
121
|
exports.cleanUrl = cleanUrl;
|
|
156
122
|
exports.encodeURIPath = encodeURIPath;
|
|
157
123
|
exports.evalValue = evalValue;
|