@coderline/alphatab-webpack 1.7.0-alpha.1536
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 +378 -0
- package/LICENSE.header +33 -0
- package/README.md +10 -0
- package/dist/alphaTab.webpack.d.ts +57 -0
- package/dist/alphaTab.webpack.js +739 -0
- package/dist/alphaTab.webpack.min.mjs +36 -0
- package/dist/alphaTab.webpack.mjs +713 -0
- package/package.json +63 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab WebPack Plugin v1.7.0-alpha.1536 (develop, build 1536)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, 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 WebPack (https://github.com/webpack/webpack/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* Copyright JS Foundation and other contributors
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
15
|
+
* a copy of this software and associated documentation files (the
|
|
16
|
+
* 'Software'), to deal in the Software without restriction, including
|
|
17
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
18
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
19
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
20
|
+
* the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be
|
|
23
|
+
* included in all copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
26
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
27
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
28
|
+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
29
|
+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
30
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
31
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
40
|
+
|
|
41
|
+
const fs = require('node:fs');
|
|
42
|
+
const path = require('node:path');
|
|
43
|
+
const url = require('node:url');
|
|
44
|
+
|
|
45
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
46
|
+
function _interopNamespaceDefault(e) {
|
|
47
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
48
|
+
if (e) {
|
|
49
|
+
for (const k in e) {
|
|
50
|
+
if (k !== 'default') {
|
|
51
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
52
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: () => e[k]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
n.default = e;
|
|
60
|
+
return Object.freeze(n);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
64
|
+
const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
65
|
+
const url__namespace = /*#__PURE__*/_interopNamespaceDefault(url);
|
|
66
|
+
|
|
67
|
+
const JAVASCRIPT_MODULE_TYPE_AUTO = 'javascript/auto';
|
|
68
|
+
const JAVASCRIPT_MODULE_TYPE_ESM = 'javascript/esm';
|
|
69
|
+
function makeDependencySerializable(webPackWithAlphaTab, dependency, key) {
|
|
70
|
+
webPackWithAlphaTab.webpack.util.serialization.register(dependency, key, null, {
|
|
71
|
+
serialize(obj, context) {
|
|
72
|
+
obj.serialize(context);
|
|
73
|
+
},
|
|
74
|
+
deserialize(context) {
|
|
75
|
+
if (typeof dependency.deserialize === 'function') {
|
|
76
|
+
return dependency.deserialize(context);
|
|
77
|
+
}
|
|
78
|
+
const obj = new dependency();
|
|
79
|
+
obj.deserialize(context);
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function tapJavaScript(normalModuleFactory, pluginName, parserPlugin) {
|
|
85
|
+
normalModuleFactory.hooks.parser.for(JAVASCRIPT_MODULE_TYPE_AUTO).tap(pluginName, parserPlugin);
|
|
86
|
+
normalModuleFactory.hooks.parser.for(JAVASCRIPT_MODULE_TYPE_ESM).tap(pluginName, parserPlugin);
|
|
87
|
+
}
|
|
88
|
+
function parseModuleUrl(parser, expr) {
|
|
89
|
+
if (expr.type !== 'NewExpression' || expr.arguments.length !== 2) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const newExpr = expr;
|
|
93
|
+
const [arg1, arg2] = newExpr.arguments;
|
|
94
|
+
const callee = parser.evaluateExpression(newExpr.callee);
|
|
95
|
+
if (!callee.isIdentifier() || !callee.identifier.includes('alphaTabUrl')) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const arg1Value = parser.evaluateExpression(arg1);
|
|
99
|
+
return [arg1Value, [arg1.range[0], arg2.range[1]]];
|
|
100
|
+
}
|
|
101
|
+
const ALPHATAB_WORKER_RUNTIME_PREFIX = 'atworker_';
|
|
102
|
+
function getWorkerRuntime(parser, compilation, cachedContextify, workerIndexMap) {
|
|
103
|
+
const i = workerIndexMap.get(parser.state) || 0;
|
|
104
|
+
workerIndexMap.set(parser.state, i + 1);
|
|
105
|
+
const name = `${cachedContextify(parser.state.module.identifier())}|${i}`;
|
|
106
|
+
const hash = compilation.compiler.webpack.util.createHash(compilation.outputOptions.hashFunction);
|
|
107
|
+
hash.update(name);
|
|
108
|
+
const digest = hash.digest(compilation.outputOptions.hashDigest);
|
|
109
|
+
const runtime = digest.slice(0, compilation.outputOptions.hashDigestLength);
|
|
110
|
+
return ALPHATAB_WORKER_RUNTIME_PREFIX + runtime;
|
|
111
|
+
}
|
|
112
|
+
function isWorkerRuntime(runtime) {
|
|
113
|
+
if (typeof runtime !== 'string') {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return runtime.startsWith(ALPHATAB_WORKER_RUNTIME_PREFIX);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function injectWorkerRuntimeModule(webPackWithAlphaTab) {
|
|
120
|
+
class AlphaTabWorkerRuntimeModule extends webPackWithAlphaTab.webpack.RuntimeModule {
|
|
121
|
+
constructor() {
|
|
122
|
+
super('alphaTab audio worker chunk loading', webPackWithAlphaTab.webpack.RuntimeModule.STAGE_BASIC);
|
|
123
|
+
}
|
|
124
|
+
generate() {
|
|
125
|
+
const compilation = this.compilation;
|
|
126
|
+
const runtimeTemplate = compilation.runtimeTemplate;
|
|
127
|
+
const globalObject = runtimeTemplate.globalObject;
|
|
128
|
+
const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify(compilation.outputOptions.chunkLoadingGlobal)}]`;
|
|
129
|
+
const initialChunkIds = new Set(this.chunk.ids);
|
|
130
|
+
for (const c of this.chunk.getAllInitialChunks()) {
|
|
131
|
+
if (webPackWithAlphaTab.webpack.javascript.JavascriptModulesPlugin.chunkHasJs(c, this.chunkGraph)) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
for (const id of c.ids) {
|
|
135
|
+
initialChunkIds.add(id);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return webPackWithAlphaTab.webpack.Template.asString([
|
|
139
|
+
`if ( ! ('AudioWorkletGlobalScope' in ${globalObject}) ) { return; }`,
|
|
140
|
+
'const installedChunks = {',
|
|
141
|
+
webPackWithAlphaTab.webpack.Template.indent(Array.from(initialChunkIds, id => `${JSON.stringify(id)}: 1`).join(',\n')),
|
|
142
|
+
'};',
|
|
143
|
+
'// importScripts chunk loading',
|
|
144
|
+
`const installChunk = ${runtimeTemplate.basicFunction('data', [
|
|
145
|
+
runtimeTemplate.destructureArray(['chunkIds', 'moreModules', 'runtime'], 'data'),
|
|
146
|
+
'for(const moduleId in moreModules) {',
|
|
147
|
+
webPackWithAlphaTab.webpack.Template.indent([
|
|
148
|
+
`if(${webPackWithAlphaTab.webpack.RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
|
|
149
|
+
webPackWithAlphaTab.webpack.Template.indent(`${webPackWithAlphaTab.webpack.RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`),
|
|
150
|
+
'}'
|
|
151
|
+
]),
|
|
152
|
+
'}',
|
|
153
|
+
`if(runtime) runtime(${webPackWithAlphaTab.webpack.RuntimeGlobals.require});`,
|
|
154
|
+
'while(chunkIds.length)',
|
|
155
|
+
webPackWithAlphaTab.webpack.Template.indent('installedChunks[chunkIds.pop()] = 1;'),
|
|
156
|
+
'parentChunkLoadingFunction(data);'
|
|
157
|
+
])};`,
|
|
158
|
+
`const chunkLoadingGlobal = ${chunkLoadingGlobalExpr} = ${chunkLoadingGlobalExpr} || [];`,
|
|
159
|
+
'const parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);',
|
|
160
|
+
'chunkLoadingGlobal.forEach(installChunk);',
|
|
161
|
+
'chunkLoadingGlobal.push = installChunk;'
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
AlphaTabWorkerRuntimeModule.Key = 'AlphaTabWorkerRuntime';
|
|
166
|
+
webPackWithAlphaTab.alphaTab.registerWebWorkerRuntimeModule = (pluginName, compilation) => {
|
|
167
|
+
compilation.hooks.runtimeRequirementInTree
|
|
168
|
+
.for(AlphaTabWorkerRuntimeModule.Key)
|
|
169
|
+
.tap(pluginName, (chunk) => {
|
|
170
|
+
compilation.addRuntimeModule(chunk, new AlphaTabWorkerRuntimeModule());
|
|
171
|
+
});
|
|
172
|
+
compilation.hooks.additionalChunkRuntimeRequirements.tap(pluginName, (chunk, runtimeRequirements) => {
|
|
173
|
+
if (isWorkerRuntime(chunk.runtime)) {
|
|
174
|
+
runtimeRequirements.add(webPackWithAlphaTab.webpack.RuntimeGlobals.moduleFactories);
|
|
175
|
+
runtimeRequirements.add(webPackWithAlphaTab.alphaTab.WebWorkerRuntimeModuleKey);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
webPackWithAlphaTab.alphaTab.WebWorkerRuntimeModuleKey = AlphaTabWorkerRuntimeModule.Key;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const AlphaTabWorkletSpecifierTag = Symbol('alphatab worklet specifier tag');
|
|
183
|
+
const workletIndexMap = new WeakMap();
|
|
184
|
+
/**
|
|
185
|
+
* Configures the Audio Worklet aspects within webpack.
|
|
186
|
+
* The counterpart which this plugin detects sits in alphaTab.main.ts
|
|
187
|
+
* @param pluginName
|
|
188
|
+
* @param options
|
|
189
|
+
* @param compiler
|
|
190
|
+
* @param compilation
|
|
191
|
+
* @param normalModuleFactory
|
|
192
|
+
* @param cachedContextify
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
function configureAudioWorklet(webPackWithAlphaTab, pluginName, options, compiler, compilation, normalModuleFactory, cachedContextify) {
|
|
196
|
+
if (options.audioWorklets === false) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
webPackWithAlphaTab.alphaTab.registerWorkletDependency(compilation, normalModuleFactory);
|
|
200
|
+
const handleAlphaTabWorklet = (parser, expr) => {
|
|
201
|
+
const [arg1] = expr.arguments;
|
|
202
|
+
const parsedUrl = parseModuleUrl(parser, arg1);
|
|
203
|
+
if (!parsedUrl) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const [url] = parsedUrl;
|
|
207
|
+
if (!url.isString()) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const runtime = getWorkerRuntime(parser, compilation, cachedContextify, workletIndexMap);
|
|
211
|
+
const block = new webPackWithAlphaTab.webpack.AsyncDependenciesBlock({
|
|
212
|
+
entryOptions: {
|
|
213
|
+
chunkLoading: false,
|
|
214
|
+
wasmLoading: false,
|
|
215
|
+
runtime: runtime,
|
|
216
|
+
library: {
|
|
217
|
+
// prevent any built-in/default library settings
|
|
218
|
+
// to be active for this chunk
|
|
219
|
+
type: 'at-worklet'
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
block.loc = expr.loc;
|
|
224
|
+
const workletBootstrap = webPackWithAlphaTab.alphaTab.createWorkletDependency(url.string, [expr.range[0], expr.range[1]], compiler.options.output.workerPublicPath);
|
|
225
|
+
workletBootstrap.loc = expr.loc;
|
|
226
|
+
block.addDependency(workletBootstrap);
|
|
227
|
+
parser.state.module.addBlock(block);
|
|
228
|
+
return true;
|
|
229
|
+
};
|
|
230
|
+
const parserPlugin = (parser) => {
|
|
231
|
+
const pattern = 'alphaTabWorklet';
|
|
232
|
+
const itemMembers = 'addModule';
|
|
233
|
+
parser.hooks.preDeclarator.tap(pluginName, (decl) => {
|
|
234
|
+
if (decl.id.type === 'Identifier' && decl.id.name === pattern) {
|
|
235
|
+
parser.tagVariable(decl.id.name, AlphaTabWorkletSpecifierTag);
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
return;
|
|
239
|
+
});
|
|
240
|
+
parser.hooks.pattern.for(pattern).tap(pluginName, (pattern) => {
|
|
241
|
+
parser.tagVariable(pattern.name, AlphaTabWorkletSpecifierTag);
|
|
242
|
+
return true;
|
|
243
|
+
});
|
|
244
|
+
parser.hooks.callMemberChain
|
|
245
|
+
.for(AlphaTabWorkletSpecifierTag)
|
|
246
|
+
.tap(pluginName, (expression, members) => {
|
|
247
|
+
if (itemMembers !== members.join('.')) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
return handleAlphaTabWorklet(parser, expression);
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
tapJavaScript(normalModuleFactory, pluginName, parserPlugin);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const workerIndexMap = new WeakMap();
|
|
257
|
+
/**
|
|
258
|
+
* Configures the WebWorker aspects within webpack.
|
|
259
|
+
* The counterpart which this plugin detects sits in alphaTab.main.ts
|
|
260
|
+
* @param pluginName
|
|
261
|
+
* @param options
|
|
262
|
+
* @param compiler
|
|
263
|
+
* @param compilation
|
|
264
|
+
* @param normalModuleFactory
|
|
265
|
+
* @param cachedContextify
|
|
266
|
+
* @returns
|
|
267
|
+
*/
|
|
268
|
+
function configureWebWorker(webPackWithAlphaTab, pluginName, options, compiler, compilation, normalModuleFactory, cachedContextify) {
|
|
269
|
+
if (options.audioWorklets === false) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
webPackWithAlphaTab.alphaTab.registerWebWorkerDependency(compilation, normalModuleFactory);
|
|
273
|
+
new webPackWithAlphaTab.webpack.javascript.EnableChunkLoadingPlugin('import-scripts').apply(compiler);
|
|
274
|
+
const handleAlphaTabWorker = (parser, expr) => {
|
|
275
|
+
const [arg1, arg2] = expr.arguments;
|
|
276
|
+
const parsedUrl = parseModuleUrl(parser, arg1);
|
|
277
|
+
if (!parsedUrl) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const [url, range] = parsedUrl;
|
|
281
|
+
if (!url.isString()) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const runtime = getWorkerRuntime(parser, compilation, cachedContextify, workerIndexMap);
|
|
285
|
+
const block = new webPackWithAlphaTab.webpack.AsyncDependenciesBlock({
|
|
286
|
+
entryOptions: {
|
|
287
|
+
chunkLoading: 'import-scripts',
|
|
288
|
+
wasmLoading: false,
|
|
289
|
+
runtime: runtime,
|
|
290
|
+
library: {
|
|
291
|
+
// prevent any built-in/default library settings
|
|
292
|
+
// to be active for this chunk
|
|
293
|
+
type: 'at-worker'
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
block.loc = expr.loc;
|
|
298
|
+
const workletBootstrap = webPackWithAlphaTab.alphaTab.createWebWorkerDependency(url.string, range, compiler.options.output.workerPublicPath);
|
|
299
|
+
workletBootstrap.loc = expr.loc;
|
|
300
|
+
block.addDependency(workletBootstrap);
|
|
301
|
+
parser.state.module.addBlock(block);
|
|
302
|
+
const dep1 = new webPackWithAlphaTab.webpack.dependencies.ConstDependency(`{ type: ${compilation.options.output.module ? '"module"' : 'undefined'} }`, arg2.range);
|
|
303
|
+
dep1.loc = expr.loc;
|
|
304
|
+
parser.state.module.addPresentationalDependency(dep1);
|
|
305
|
+
parser.walkExpression(expr.callee);
|
|
306
|
+
parser.walkExpression(arg1.callee);
|
|
307
|
+
return true;
|
|
308
|
+
};
|
|
309
|
+
const parserPlugin = (parser) => {
|
|
310
|
+
parser.hooks.new
|
|
311
|
+
.for('alphaTab.Environment.alphaTabWorker')
|
|
312
|
+
.tap(pluginName, (expr) => handleAlphaTabWorker(parser, expr));
|
|
313
|
+
};
|
|
314
|
+
tapJavaScript(normalModuleFactory, pluginName, parserPlugin);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function injectWebWorkerDependency(webPackWithAlphaTab) {
|
|
318
|
+
class AlphaTabWebWorkerDependency extends webPackWithAlphaTab.webpack.dependencies.ModuleDependency {
|
|
319
|
+
constructor(request, range, publicPath) {
|
|
320
|
+
super(request);
|
|
321
|
+
this.range = range;
|
|
322
|
+
this.publicPath = publicPath;
|
|
323
|
+
}
|
|
324
|
+
getReferencedExports() {
|
|
325
|
+
return webPackWithAlphaTab.webpack.Dependency.NO_EXPORTS_REFERENCED;
|
|
326
|
+
}
|
|
327
|
+
get type() {
|
|
328
|
+
return 'alphaTabWorker';
|
|
329
|
+
}
|
|
330
|
+
get category() {
|
|
331
|
+
return 'worker';
|
|
332
|
+
}
|
|
333
|
+
updateHash(hash) {
|
|
334
|
+
if (this._hashUpdate === undefined) {
|
|
335
|
+
this._hashUpdate = JSON.stringify(this.publicPath);
|
|
336
|
+
}
|
|
337
|
+
hash.update(this._hashUpdate);
|
|
338
|
+
}
|
|
339
|
+
serialize(context) {
|
|
340
|
+
const { write } = context;
|
|
341
|
+
write(this.publicPath);
|
|
342
|
+
super.serialize(context);
|
|
343
|
+
}
|
|
344
|
+
deserialize(context) {
|
|
345
|
+
const { read } = context;
|
|
346
|
+
this.publicPath = read();
|
|
347
|
+
super.deserialize(context);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
AlphaTabWebWorkerDependency.Template = class WorkerDependencyTemplate extends (webPackWithAlphaTab.webpack.dependencies.ModuleDependency.Template) {
|
|
351
|
+
apply(dependency, source, templateContext) {
|
|
352
|
+
const { chunkGraph, moduleGraph, runtimeRequirements } = templateContext;
|
|
353
|
+
const dep = dependency;
|
|
354
|
+
const block = moduleGraph.getParentBlock(dependency);
|
|
355
|
+
const entrypoint = chunkGraph.getBlockChunkGroup(block);
|
|
356
|
+
const chunk = entrypoint.getEntrypointChunk();
|
|
357
|
+
// We use the workerPublicPath option if provided, else we fallback to the RuntimeGlobal publicPath
|
|
358
|
+
const workerImportBaseUrl = dep.publicPath
|
|
359
|
+
? `"${dep.publicPath}"`
|
|
360
|
+
: webPackWithAlphaTab.webpack.RuntimeGlobals.publicPath;
|
|
361
|
+
runtimeRequirements.add(webPackWithAlphaTab.webpack.RuntimeGlobals.publicPath);
|
|
362
|
+
runtimeRequirements.add(webPackWithAlphaTab.webpack.RuntimeGlobals.baseURI);
|
|
363
|
+
runtimeRequirements.add(webPackWithAlphaTab.webpack.RuntimeGlobals.getChunkScriptFilename);
|
|
364
|
+
source.replace(dep.range[0], dep.range[1] - 1, `/* worker import */ ${workerImportBaseUrl} + ${webPackWithAlphaTab.webpack.RuntimeGlobals.getChunkScriptFilename}(${JSON.stringify(chunk.id)}), ${webPackWithAlphaTab.webpack.RuntimeGlobals.baseURI}`);
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
makeDependencySerializable(webPackWithAlphaTab, AlphaTabWebWorkerDependency, 'AlphaTabWebWorkerDependency');
|
|
368
|
+
webPackWithAlphaTab.alphaTab.createWebWorkerDependency = (request, range, publicPath) => new AlphaTabWebWorkerDependency(request, range, publicPath);
|
|
369
|
+
webPackWithAlphaTab.alphaTab.registerWebWorkerDependency = (compilation, normalModuleFactory) => {
|
|
370
|
+
compilation.dependencyFactories.set(AlphaTabWebWorkerDependency, normalModuleFactory);
|
|
371
|
+
compilation.dependencyTemplates.set(AlphaTabWebWorkerDependency, new AlphaTabWebWorkerDependency.Template());
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function injectWorkletRuntimeModule(webPackWithAlphaTab) {
|
|
376
|
+
class AlphaTabWorkletStartRuntimeModule extends webPackWithAlphaTab.webpack.RuntimeModule {
|
|
377
|
+
constructor() {
|
|
378
|
+
super('alphaTab audio worklet chunk lookup', webPackWithAlphaTab.webpack.RuntimeModule.STAGE_BASIC);
|
|
379
|
+
}
|
|
380
|
+
generate() {
|
|
381
|
+
const compilation = this.compilation;
|
|
382
|
+
const workletChunkLookup = new Map();
|
|
383
|
+
const allChunks = compilation.chunks;
|
|
384
|
+
for (const chunk of allChunks) {
|
|
385
|
+
const isWorkletEntry = isWorkerRuntime(chunk.runtime);
|
|
386
|
+
if (isWorkletEntry) {
|
|
387
|
+
const workletChunks = Array.from(chunk.getAllReferencedChunks()).map(c => {
|
|
388
|
+
// force content chunk to be created
|
|
389
|
+
compilation.hooks.contentHash.call(c);
|
|
390
|
+
return compilation.getPath(webPackWithAlphaTab.webpack.javascript.JavascriptModulesPlugin.getChunkFilenameTemplate(c, compilation.outputOptions), {
|
|
391
|
+
chunk: c,
|
|
392
|
+
contentHashType: 'javascript'
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
workletChunkLookup.set(String(chunk.id), workletChunks);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return webPackWithAlphaTab.webpack.Template.asString([
|
|
399
|
+
`${AlphaTabWorkletStartRuntimeModule.RuntimeGlobalWorkletGetStartupChunks} = (() => {`,
|
|
400
|
+
webPackWithAlphaTab.webpack.Template.indent([
|
|
401
|
+
'const lookup = new Map(',
|
|
402
|
+
webPackWithAlphaTab.webpack.Template.indent(JSON.stringify(Array.from(workletChunkLookup.entries()))),
|
|
403
|
+
');',
|
|
404
|
+
'return (chunkId) => lookup.get(String(chunkId)) ?? [];'
|
|
405
|
+
]),
|
|
406
|
+
'})();'
|
|
407
|
+
]);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
AlphaTabWorkletStartRuntimeModule.RuntimeGlobalWorkletGetStartupChunks = '__webpack_require__.wsc';
|
|
411
|
+
webPackWithAlphaTab.alphaTab.RuntimeGlobalWorkletGetStartupChunks =
|
|
412
|
+
AlphaTabWorkletStartRuntimeModule.RuntimeGlobalWorkletGetStartupChunks;
|
|
413
|
+
webPackWithAlphaTab.alphaTab.registerWorkletRuntimeModule = (pluginName, compilation) => {
|
|
414
|
+
compilation.hooks.runtimeRequirementInTree
|
|
415
|
+
.for(AlphaTabWorkletStartRuntimeModule.RuntimeGlobalWorkletGetStartupChunks)
|
|
416
|
+
.tap(pluginName, (chunk) => {
|
|
417
|
+
compilation.addRuntimeModule(chunk, new AlphaTabWorkletStartRuntimeModule());
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function injectWorkletDependency(webPackWithAlphaTab) {
|
|
423
|
+
/**
|
|
424
|
+
* This module dependency injects the relevant code into a worklet bootstrap script
|
|
425
|
+
* to install chunks which have been added to the worklet via addModule before the bootstrap script starts.
|
|
426
|
+
*/
|
|
427
|
+
class AlphaTabWorkletDependency extends webPackWithAlphaTab.webpack.dependencies.ModuleDependency {
|
|
428
|
+
constructor(url, range, publicPath) {
|
|
429
|
+
super(url);
|
|
430
|
+
this.range = range;
|
|
431
|
+
this.publicPath = publicPath;
|
|
432
|
+
}
|
|
433
|
+
get type() {
|
|
434
|
+
return 'alphaTabWorklet';
|
|
435
|
+
}
|
|
436
|
+
get category() {
|
|
437
|
+
return 'worker';
|
|
438
|
+
}
|
|
439
|
+
updateHash(hash) {
|
|
440
|
+
if (this._hashUpdate === undefined) {
|
|
441
|
+
this._hashUpdate = JSON.stringify(this.publicPath);
|
|
442
|
+
}
|
|
443
|
+
hash.update(this._hashUpdate);
|
|
444
|
+
}
|
|
445
|
+
serialize(context) {
|
|
446
|
+
const { write } = context;
|
|
447
|
+
write(this.publicPath);
|
|
448
|
+
super.serialize(context);
|
|
449
|
+
}
|
|
450
|
+
deserialize(context) {
|
|
451
|
+
const { read } = context;
|
|
452
|
+
this.publicPath = read();
|
|
453
|
+
super.deserialize(context);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
AlphaTabWorkletDependency.Template = class AlphaTabWorkletDependencyTemplate extends (webPackWithAlphaTab.webpack.dependencies.ModuleDependency.Template) {
|
|
457
|
+
apply(dependency, source, templateContext) {
|
|
458
|
+
const { chunkGraph, moduleGraph, runtimeRequirements } = templateContext;
|
|
459
|
+
const dep = dependency;
|
|
460
|
+
const block = moduleGraph.getParentBlock(dependency);
|
|
461
|
+
const entrypoint = chunkGraph.getBlockChunkGroup(block);
|
|
462
|
+
const workletImportBaseUrl = dep.publicPath
|
|
463
|
+
? JSON.stringify(dep.publicPath)
|
|
464
|
+
: webPackWithAlphaTab.webpack.RuntimeGlobals.publicPath;
|
|
465
|
+
const chunk = entrypoint.getEntrypointChunk();
|
|
466
|
+
// worklet global scope has no 'self', need to inject it for compatibility with chunks
|
|
467
|
+
// some plugins like the auto public path need to right location. we pass this on from the main runtime
|
|
468
|
+
// some plugins rely on importScripts to be defined.
|
|
469
|
+
const workletInlineBootstrap = `
|
|
470
|
+
globalThis.self = globalThis.self || globalThis;
|
|
471
|
+
globalThis.location = \${JSON.stringify(${webPackWithAlphaTab.webpack.RuntimeGlobals.baseURI})};
|
|
472
|
+
globalThis.importScripts = (url) => { throw new Error("importScripts not available, dynamic loading of chunks not supported in this context", url) };
|
|
473
|
+
`;
|
|
474
|
+
chunkGraph.addChunkRuntimeRequirements(chunk, new Set([
|
|
475
|
+
webPackWithAlphaTab.webpack.RuntimeGlobals.moduleFactories,
|
|
476
|
+
webPackWithAlphaTab.alphaTab.WebWorkerRuntimeModuleKey
|
|
477
|
+
]));
|
|
478
|
+
runtimeRequirements.add(webPackWithAlphaTab.alphaTab.RuntimeGlobalWorkletGetStartupChunks);
|
|
479
|
+
source.replace(dep.range[0], dep.range[1] - 1, webPackWithAlphaTab.webpack.Template.asString([
|
|
480
|
+
'(/* worklet bootstrap */ async function(__webpack_worklet__) {',
|
|
481
|
+
webPackWithAlphaTab.webpack.Template.indent([
|
|
482
|
+
`await __webpack_worklet__.addModule(URL.createObjectURL(new Blob([\`${workletInlineBootstrap}\`], { type: "application/javascript; charset=utf-8" })));`,
|
|
483
|
+
`for (const fileName of ${webPackWithAlphaTab.alphaTab.RuntimeGlobalWorkletGetStartupChunks}(${JSON.stringify(chunk.id)})) {`,
|
|
484
|
+
webPackWithAlphaTab.webpack.Template.indent([
|
|
485
|
+
`await __webpack_worklet__.addModule(new URL(${workletImportBaseUrl} + fileName, ${webPackWithAlphaTab.webpack.RuntimeGlobals.baseURI}));`
|
|
486
|
+
]),
|
|
487
|
+
'}'
|
|
488
|
+
]),
|
|
489
|
+
'})(alphaTabWorklet)'
|
|
490
|
+
]));
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
makeDependencySerializable(webPackWithAlphaTab, AlphaTabWorkletDependency, 'AlphaTabWorkletDependency');
|
|
494
|
+
webPackWithAlphaTab.alphaTab.registerWorkletDependency = (compilation, normalModuleFactory) => {
|
|
495
|
+
compilation.dependencyFactories.set(AlphaTabWorkletDependency, normalModuleFactory);
|
|
496
|
+
compilation.dependencyTemplates.set(AlphaTabWorkletDependency, new AlphaTabWorkletDependency.Template());
|
|
497
|
+
};
|
|
498
|
+
webPackWithAlphaTab.alphaTab.createWorkletDependency = (request, range, publicPath) => new AlphaTabWorkletDependency(request, range, publicPath);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**@target web */
|
|
502
|
+
const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/;
|
|
503
|
+
const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
|
|
504
|
+
const relativePathToRequest = (relativePath) => {
|
|
505
|
+
if (relativePath === '') {
|
|
506
|
+
return './.';
|
|
507
|
+
}
|
|
508
|
+
if (relativePath === '..') {
|
|
509
|
+
return '../.';
|
|
510
|
+
}
|
|
511
|
+
if (relativePath.startsWith('../')) {
|
|
512
|
+
return relativePath;
|
|
513
|
+
}
|
|
514
|
+
return `./${relativePath}`;
|
|
515
|
+
};
|
|
516
|
+
const absoluteToRequest = (context, maybeAbsolutePath) => {
|
|
517
|
+
if (maybeAbsolutePath[0] === '/') {
|
|
518
|
+
if (maybeAbsolutePath.length > 1 && maybeAbsolutePath[maybeAbsolutePath.length - 1] === '/') {
|
|
519
|
+
// this 'path' is actually a regexp generated by dynamic requires.
|
|
520
|
+
// Don't treat it as an absolute path.
|
|
521
|
+
return maybeAbsolutePath;
|
|
522
|
+
}
|
|
523
|
+
const querySplitPos = maybeAbsolutePath.indexOf('?');
|
|
524
|
+
let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
525
|
+
resource = relativePathToRequest(path__namespace.posix.relative(context, resource));
|
|
526
|
+
return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
527
|
+
}
|
|
528
|
+
if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
|
|
529
|
+
const querySplitPos = maybeAbsolutePath.indexOf('?');
|
|
530
|
+
let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
531
|
+
resource = path__namespace.win32.relative(context, resource);
|
|
532
|
+
if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) {
|
|
533
|
+
resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/'));
|
|
534
|
+
}
|
|
535
|
+
return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
536
|
+
}
|
|
537
|
+
// not an absolute path
|
|
538
|
+
return maybeAbsolutePath;
|
|
539
|
+
};
|
|
540
|
+
const _contextify = (context, request) => {
|
|
541
|
+
return request
|
|
542
|
+
.split('!')
|
|
543
|
+
.map(r => absoluteToRequest(context, r))
|
|
544
|
+
.join('!');
|
|
545
|
+
};
|
|
546
|
+
const makeCacheableWithContext = (fn) => {
|
|
547
|
+
const cache = new WeakMap();
|
|
548
|
+
const cachedFn = (context, identifier, associatedObjectForCache) => {
|
|
549
|
+
if (!associatedObjectForCache) {
|
|
550
|
+
return fn(context, identifier);
|
|
551
|
+
}
|
|
552
|
+
let innerCache = cache.get(associatedObjectForCache);
|
|
553
|
+
if (innerCache === undefined) {
|
|
554
|
+
innerCache = new Map();
|
|
555
|
+
cache.set(associatedObjectForCache, innerCache);
|
|
556
|
+
}
|
|
557
|
+
let cachedResult;
|
|
558
|
+
let innerSubCache = innerCache.get(context);
|
|
559
|
+
if (innerSubCache === undefined) {
|
|
560
|
+
innerSubCache = new Map();
|
|
561
|
+
innerCache.set(context, innerSubCache);
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
cachedResult = innerSubCache.get(identifier);
|
|
565
|
+
}
|
|
566
|
+
if (cachedResult !== undefined) {
|
|
567
|
+
return cachedResult;
|
|
568
|
+
}
|
|
569
|
+
const result = fn(context, identifier);
|
|
570
|
+
innerSubCache.set(identifier, result);
|
|
571
|
+
return result;
|
|
572
|
+
};
|
|
573
|
+
cachedFn.bindContextCache = (context, associatedObjectForCache) => {
|
|
574
|
+
let innerSubCache;
|
|
575
|
+
if (associatedObjectForCache) {
|
|
576
|
+
let innerCache = cache.get(associatedObjectForCache);
|
|
577
|
+
if (innerCache === undefined) {
|
|
578
|
+
innerCache = new Map();
|
|
579
|
+
cache.set(associatedObjectForCache, innerCache);
|
|
580
|
+
}
|
|
581
|
+
innerSubCache = innerCache.get(context);
|
|
582
|
+
if (innerSubCache === undefined) {
|
|
583
|
+
innerSubCache = new Map();
|
|
584
|
+
innerCache.set(context, innerSubCache);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
innerSubCache = new Map();
|
|
589
|
+
}
|
|
590
|
+
const boundFn = (identifier) => {
|
|
591
|
+
const cachedResult = innerSubCache.get(identifier);
|
|
592
|
+
if (cachedResult !== undefined) {
|
|
593
|
+
return cachedResult;
|
|
594
|
+
}
|
|
595
|
+
const result = fn(context, identifier);
|
|
596
|
+
innerSubCache.set(identifier, result);
|
|
597
|
+
return result;
|
|
598
|
+
};
|
|
599
|
+
return boundFn;
|
|
600
|
+
};
|
|
601
|
+
return cachedFn;
|
|
602
|
+
};
|
|
603
|
+
const contextify = makeCacheableWithContext(_contextify);
|
|
604
|
+
class AlphaTabWebPackPlugin {
|
|
605
|
+
constructor(options) {
|
|
606
|
+
this.options = options ?? {};
|
|
607
|
+
}
|
|
608
|
+
apply(compiler) {
|
|
609
|
+
// here we create all plugin related class implementations using
|
|
610
|
+
// the webpack instance provided to this plugin (not as global import)
|
|
611
|
+
// after that we use the helper and factory functions we add to webpack
|
|
612
|
+
const webPackWithAlphaTab = {
|
|
613
|
+
webpack: compiler.webpack,
|
|
614
|
+
alphaTab: {}
|
|
615
|
+
};
|
|
616
|
+
if ('alphaTab' in compiler.webpack.util.serialization.register) {
|
|
617
|
+
// prevent multi registration
|
|
618
|
+
webPackWithAlphaTab.alphaTab = compiler.webpack.util.serialization.register.alphaTab;
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
compiler.webpack.util.serialization.register.alphaTab = webPackWithAlphaTab.alphaTab;
|
|
622
|
+
injectWebWorkerDependency(webPackWithAlphaTab);
|
|
623
|
+
injectWorkerRuntimeModule(webPackWithAlphaTab);
|
|
624
|
+
injectWorkletDependency(webPackWithAlphaTab);
|
|
625
|
+
injectWorkletRuntimeModule(webPackWithAlphaTab);
|
|
626
|
+
}
|
|
627
|
+
this._webPackWithAlphaTab = webPackWithAlphaTab;
|
|
628
|
+
this.configureSoundFont(compiler);
|
|
629
|
+
this.configure(compiler);
|
|
630
|
+
}
|
|
631
|
+
configureSoundFont(compiler) {
|
|
632
|
+
if (this.options.assetOutputDir === false) {
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
// register soundfont as resource
|
|
636
|
+
compiler.options.module.rules.push({
|
|
637
|
+
test: /\.sf2/,
|
|
638
|
+
type: 'asset/resource'
|
|
639
|
+
});
|
|
640
|
+
compiler.options.module.rules.push({
|
|
641
|
+
test: /\.sf3/,
|
|
642
|
+
type: 'asset/resource'
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
configure(compiler) {
|
|
646
|
+
const pluginName = this.constructor.name;
|
|
647
|
+
const cachedContextify = contextify.bindContextCache(compiler.context, compiler.root);
|
|
648
|
+
compiler.hooks.thisCompilation.tap(pluginName, (compilation, { normalModuleFactory }) => {
|
|
649
|
+
this._webPackWithAlphaTab.alphaTab.registerWebWorkerRuntimeModule(pluginName, compilation);
|
|
650
|
+
this._webPackWithAlphaTab.alphaTab.registerWorkletRuntimeModule(pluginName, compilation);
|
|
651
|
+
configureAudioWorklet(this._webPackWithAlphaTab, pluginName, this.options, compiler, compilation, normalModuleFactory, cachedContextify);
|
|
652
|
+
configureWebWorker(this._webPackWithAlphaTab, pluginName, this.options, compiler, compilation, normalModuleFactory, cachedContextify);
|
|
653
|
+
this.configureAssetCopy(this._webPackWithAlphaTab, pluginName, compiler, compilation);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
configureAssetCopy(webPackWithAlphaTab, pluginName, compiler, compilation) {
|
|
657
|
+
if (this.options.assetOutputDir === false) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
const options = this.options;
|
|
661
|
+
compilation.hooks.processAssets.tapAsync({
|
|
662
|
+
name: pluginName,
|
|
663
|
+
stage: this._webPackWithAlphaTab.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
|
664
|
+
}, async (_, callback) => {
|
|
665
|
+
let alphaTabSourceDir = options.alphaTabSourceDir;
|
|
666
|
+
if (!alphaTabSourceDir) {
|
|
667
|
+
try {
|
|
668
|
+
const isEsm = typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('alphaTab.webpack.js', document.baseURI).href)) === 'string';
|
|
669
|
+
if (isEsm) {
|
|
670
|
+
alphaTabSourceDir = url__namespace.fileURLToPath(undefined('@coderline/alphatab'));
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
alphaTabSourceDir = require.resolve('@coderline/alphatab');
|
|
674
|
+
}
|
|
675
|
+
alphaTabSourceDir = path__namespace.resolve(alphaTabSourceDir, '..');
|
|
676
|
+
}
|
|
677
|
+
catch {
|
|
678
|
+
alphaTabSourceDir = compilation.getPath('node_modules/@coderline/alphatab/dist/');
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
let isValidAlphaTabSourceDir;
|
|
682
|
+
if (alphaTabSourceDir) {
|
|
683
|
+
try {
|
|
684
|
+
await fs__namespace.promises.access(path__namespace.join(alphaTabSourceDir, 'alphaTab.mjs'), fs__namespace.constants.F_OK);
|
|
685
|
+
isValidAlphaTabSourceDir = true;
|
|
686
|
+
}
|
|
687
|
+
catch {
|
|
688
|
+
isValidAlphaTabSourceDir = false;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
isValidAlphaTabSourceDir = false;
|
|
693
|
+
}
|
|
694
|
+
if (!isValidAlphaTabSourceDir) {
|
|
695
|
+
compilation.errors.push(new this._webPackWithAlphaTab.webpack.WebpackError('Could not find alphaTab, please ensure it is installed into node_modules or configure alphaTabSourceDir'));
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
const outputPath = (options.assetOutputDir ?? compiler.options.output.path);
|
|
699
|
+
if (!outputPath) {
|
|
700
|
+
compilation.errors.push(new this._webPackWithAlphaTab.webpack.WebpackError('Need output.path configured in application to store asset files.'));
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
async function copyFiles(subdir) {
|
|
704
|
+
const fullDir = path__namespace.join(alphaTabSourceDir, subdir);
|
|
705
|
+
compilation.contextDependencies.add(path__namespace.normalize(fullDir));
|
|
706
|
+
const files = await fs__namespace.promises.readdir(fullDir, { withFileTypes: true });
|
|
707
|
+
await fs__namespace.promises.mkdir(path__namespace.join(outputPath, subdir), { recursive: true });
|
|
708
|
+
await Promise.all(files
|
|
709
|
+
.filter(f => f.isFile())
|
|
710
|
+
.map(async (file) => {
|
|
711
|
+
// node v20.12.0 has parentPath pointing to the path (not the file)
|
|
712
|
+
// see https://github.com/nodejs/node/pull/50976
|
|
713
|
+
const sourceFilename = path__namespace.join(file.parentPath ?? file.path, file.name);
|
|
714
|
+
await fs__namespace.promises.copyFile(sourceFilename, path__namespace.join(outputPath, subdir, file.name));
|
|
715
|
+
const assetFileName = `${subdir}/${file.name}`;
|
|
716
|
+
const existingAsset = compilation.getAsset(assetFileName);
|
|
717
|
+
const data = await fs__namespace.promises.readFile(sourceFilename);
|
|
718
|
+
const source = new webPackWithAlphaTab.webpack.sources.RawSource(data);
|
|
719
|
+
if (existingAsset) {
|
|
720
|
+
compilation.updateAsset(assetFileName, source, {
|
|
721
|
+
copied: true,
|
|
722
|
+
sourceFilename
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
compilation.emitAsset(assetFileName, source, {
|
|
727
|
+
copied: true,
|
|
728
|
+
sourceFilename
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
}));
|
|
732
|
+
}
|
|
733
|
+
await Promise.all([copyFiles('font'), copyFiles('soundfont')]);
|
|
734
|
+
callback();
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
exports.AlphaTabWebPackPlugin = AlphaTabWebPackPlugin;
|