MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / workerFileToUrl

Function workerFileToUrl

packages/vite/src/bridge/worker.ts:64–77  ·  view source on GitHub ↗
(config: ResolvedConfig, id: string)

Source from the content-addressed store, hash-verified

62 * @internal
63 */
64export async function workerFileToUrl(config: ResolvedConfig, id: string): Promise<string> {
65 const workerMap = workerCache.get(config.mainConfig || config)!;
66 let fileName = workerMap.bundle.get(id);
67 if (!fileName) {
68 const outputChunk = await bundleWorkerEntry(config, id);
69 fileName = outputChunk.fileName;
70 saveEmitWorkerAsset(config, {
71 fileName,
72 source: outputChunk.code
73 });
74 workerMap.bundle.set(id, fileName);
75 }
76 return encodeWorkerAssetFileName(fileName, workerMap);
77}
78
79// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/plugins/worker.ts#L149
80function encodeWorkerAssetFileName(fileName: string, workerCache: WorkerCache): string {

Callers 1

transformFunction · 0.90

Calls 5

bundleWorkerEntryFunction · 0.85
saveEmitWorkerAssetFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected