@coderline/alphatab-vite 1.8.2 → 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 +15 -15
|
@@ -1,148 +1,124 @@
|
|
|
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
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// index.ts for more details on contents and license of this file
|
|
45
|
-
// https://github.com/Danielku15/vite/blob/88b7def341f12d07d7d4f83cbe3dc73cc8c6b7be/packages/vite/src/node/optimizer/index.ts#L1356
|
|
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 { METADATA_FILENAME } from "./constants.mjs";
|
|
38
|
+
import { tryFsResolve } from "./resolve.mjs";
|
|
39
|
+
import fs from "node:fs";
|
|
40
|
+
import * as path$1 from "node:path";
|
|
41
|
+
import { normalizePath } from "vite";
|
|
42
|
+
//#region src/bridge/optimizer.ts
|
|
46
43
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
49
46
|
function tryOptimizedDepResolve(config, ssr, url, depId, preserveSymlinks) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const resolvedFile = path.resolve(path.dirname(depSrc), url);
|
|
57
|
-
return tryFsResolve(resolvedFile, preserveSymlinks);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return undefined;
|
|
47
|
+
const optimizer = getDepsOptimizer(config, ssr);
|
|
48
|
+
if (optimizer?.isOptimizedDepFile(depId)) {
|
|
49
|
+
const depFile = cleanUrl(depId);
|
|
50
|
+
const depSrc = optimizedDepInfoFromFile(optimizer.metadata, depFile)?.src;
|
|
51
|
+
if (depSrc) return tryFsResolve(path$1.resolve(path$1.dirname(depSrc), url), preserveSymlinks);
|
|
52
|
+
}
|
|
61
53
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const devSsrDepsOptimizerMap = new WeakMap();
|
|
54
|
+
var depsOptimizerMap = /* @__PURE__ */ new WeakMap();
|
|
55
|
+
var devSsrDepsOptimizerMap = /* @__PURE__ */ new WeakMap();
|
|
65
56
|
function getDepsOptimizer(config, ssr) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
const map = ssr ? devSsrDepsOptimizerMap : depsOptimizerMap;
|
|
58
|
+
let optimizer = map.get(config);
|
|
59
|
+
if (!optimizer) {
|
|
60
|
+
optimizer = createDepsOptimizer(config);
|
|
61
|
+
map.set(config, optimizer);
|
|
62
|
+
}
|
|
63
|
+
return optimizer;
|
|
73
64
|
}
|
|
74
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/optimizer/optimizer.ts#L79
|
|
75
65
|
function createDepsOptimizer(config) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
return depsOptimizer;
|
|
66
|
+
const depsCacheDirPrefix = normalizePath(path$1.resolve(config.cacheDir, "deps"));
|
|
67
|
+
const metadata = parseDepsOptimizerMetadata(fs.readFileSync(path$1.join(depsCacheDirPrefix, METADATA_FILENAME), "utf8"), depsCacheDirPrefix);
|
|
68
|
+
const notImplemented = () => {
|
|
69
|
+
throw new Error("not implemented");
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
async init() {},
|
|
73
|
+
metadata,
|
|
74
|
+
registerMissingImport: notImplemented,
|
|
75
|
+
run: notImplemented,
|
|
76
|
+
isOptimizedDepFile: (id) => id.startsWith(depsCacheDirPrefix),
|
|
77
|
+
isOptimizedDepUrl: notImplemented,
|
|
78
|
+
getOptimizedDepId: notImplemented,
|
|
79
|
+
close: notImplemented,
|
|
80
|
+
options: {}
|
|
81
|
+
};
|
|
94
82
|
}
|
|
95
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/optimizer/index.ts#L944
|
|
96
83
|
function parseDepsOptimizerMetadata(jsonMetadata, depsCacheDir) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
for (const id of Object.keys(chunks)) {
|
|
125
|
-
addOptimizedDepInfo(metadata, 'chunks', {
|
|
126
|
-
...chunks[id],
|
|
127
|
-
id,
|
|
128
|
-
browserHash,
|
|
129
|
-
needsInterop: false
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return metadata;
|
|
84
|
+
const { hash, lockfileHash, configHash, browserHash, optimized, chunks } = JSON.parse(jsonMetadata, (key, value) => {
|
|
85
|
+
if (key === "file" || key === "src") return normalizePath(path$1.resolve(depsCacheDir, value));
|
|
86
|
+
return value;
|
|
87
|
+
});
|
|
88
|
+
if (!chunks || Object.values(optimized).some((depInfo) => !depInfo.fileHash)) return;
|
|
89
|
+
const metadata = {
|
|
90
|
+
hash,
|
|
91
|
+
lockfileHash,
|
|
92
|
+
configHash,
|
|
93
|
+
browserHash,
|
|
94
|
+
optimized: {},
|
|
95
|
+
discovered: {},
|
|
96
|
+
chunks: {},
|
|
97
|
+
depInfoList: []
|
|
98
|
+
};
|
|
99
|
+
for (const id of Object.keys(optimized)) addOptimizedDepInfo(metadata, "optimized", {
|
|
100
|
+
...optimized[id],
|
|
101
|
+
id,
|
|
102
|
+
browserHash
|
|
103
|
+
});
|
|
104
|
+
for (const id of Object.keys(chunks)) addOptimizedDepInfo(metadata, "chunks", {
|
|
105
|
+
...chunks[id],
|
|
106
|
+
id,
|
|
107
|
+
browserHash,
|
|
108
|
+
needsInterop: false
|
|
109
|
+
});
|
|
110
|
+
return metadata;
|
|
133
111
|
}
|
|
134
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/optimizer/index.ts#L322
|
|
135
112
|
function addOptimizedDepInfo(metadata, type, depInfo) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
113
|
+
metadata[type][depInfo.id] = depInfo;
|
|
114
|
+
metadata.depInfoList.push(depInfo);
|
|
115
|
+
return depInfo;
|
|
139
116
|
}
|
|
140
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/optimizer/index.ts#L1248
|
|
141
117
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
144
120
|
function optimizedDepInfoFromFile(metadata, file) {
|
|
145
|
-
|
|
121
|
+
return metadata.depInfoList.find((depInfo) => depInfo.file === file);
|
|
146
122
|
}
|
|
147
|
-
|
|
123
|
+
//#endregion
|
|
148
124
|
export { optimizedDepInfoFromFile, tryOptimizedDepResolve };
|
package/dist/bridge/plugins.cjs
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
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
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
40
|
-
|
|
41
|
-
// index.ts for more details on contents and license of this file
|
|
42
|
-
// https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/plugins/index.ts#L161
|
|
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
|
+
//#region src/bridge/plugins.ts
|
|
43
38
|
/**
|
|
44
|
-
|
|
39
|
+
* @internal
|
|
45
40
|
*/
|
|
46
|
-
// biome-ignore lint/complexity/noBannedTypes: Function type needed here
|
|
47
41
|
function getHookHandler(hook) {
|
|
48
|
-
|
|
42
|
+
return typeof hook === "object" ? hook.handler : hook;
|
|
49
43
|
}
|
|
50
|
-
|
|
44
|
+
//#endregion
|
|
51
45
|
exports.getHookHandler = getHookHandler;
|
package/dist/bridge/plugins.mjs
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
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
|
-
// index.ts for more details on contents and license of this file
|
|
38
|
-
// https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/plugins/index.ts#L161
|
|
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
|
+
//#region src/bridge/plugins.ts
|
|
39
37
|
/**
|
|
40
|
-
|
|
38
|
+
* @internal
|
|
41
39
|
*/
|
|
42
|
-
// biome-ignore lint/complexity/noBannedTypes: Function type needed here
|
|
43
40
|
function getHookHandler(hook) {
|
|
44
|
-
|
|
41
|
+
return typeof hook === "object" ? hook.handler : hook;
|
|
45
42
|
}
|
|
46
|
-
|
|
43
|
+
//#endregion
|
|
47
44
|
export { getHookHandler };
|
package/dist/bridge/resolve.cjs
CHANGED
|
@@ -1,75 +1,63 @@
|
|
|
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
|
-
const vite = require('vite');
|
|
42
|
-
const bridge_fsUtils = require('./fsUtils.cjs');
|
|
43
|
-
const bridge_utils = require('./utils.cjs');
|
|
44
|
-
|
|
45
|
-
// index.ts for more details on contents and license of this file
|
|
46
|
-
// 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
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
37
|
+
const require_bridge_utils = require("./utils.cjs");
|
|
38
|
+
const require_bridge_fsUtils = require("./fsUtils.cjs");
|
|
39
|
+
let vite = require("vite");
|
|
40
|
+
//#region src/bridge/resolve.ts
|
|
47
41
|
function splitFileAndPostfix(path) {
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
const file = require_bridge_utils.cleanUrl(path);
|
|
43
|
+
return {
|
|
44
|
+
file,
|
|
45
|
+
postfix: path.slice(file.length)
|
|
46
|
+
};
|
|
50
47
|
}
|
|
51
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/resolve.ts#L566-L574
|
|
52
48
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
55
51
|
function tryFsResolve(fsPath, preserveSymlinks) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return res + postfix;
|
|
60
|
-
}
|
|
61
|
-
return;
|
|
52
|
+
const { file, postfix } = splitFileAndPostfix(fsPath);
|
|
53
|
+
const res = tryCleanFsResolve(file, preserveSymlinks);
|
|
54
|
+
if (res) return res + postfix;
|
|
62
55
|
}
|
|
63
|
-
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/resolve.ts#L580
|
|
64
56
|
function tryCleanFsResolve(file, preserveSymlinks) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!normalizedResolved) {
|
|
70
|
-
return bridge_fsUtils.tryResolveRealFile(file, preserveSymlinks);
|
|
71
|
-
}
|
|
72
|
-
return normalizedResolved;
|
|
57
|
+
if (file.includes("node_modules")) return require_bridge_fsUtils.tryResolveRealFile(file, preserveSymlinks);
|
|
58
|
+
const normalizedResolved = require_bridge_fsUtils.tryResolveRealFile((0, vite.normalizePath)(file));
|
|
59
|
+
if (!normalizedResolved) return require_bridge_fsUtils.tryResolveRealFile(file, preserveSymlinks);
|
|
60
|
+
return normalizedResolved;
|
|
73
61
|
}
|
|
74
|
-
|
|
62
|
+
//#endregion
|
|
75
63
|
exports.tryFsResolve = tryFsResolve;
|