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

Function writeBundle

packages/tooling/src/vite.ts:205–225  ·  view source on GitHub ↗
(opts, bundle)

Source from the content-addressed store, hash-verified

203 (o.plugins as OutputPlugin[]).push({
204 name: 'alphatab:bundle-dts',
205 async writeBundle(opts, bundle) {
206 for (const fileName of Object.keys(bundle)) {
207 const chunk = bundle[fileName];
208 if (
209 chunk.type !== 'chunk' ||
210 !chunk.isEntry ||
211 !fileName.endsWith('.mjs') ||
212 !shouldEmitForChunk(chunk)
213 ) {
214 continue;
215 }
216 // intermediates mirror the entry's path relative to src/ (rootDir).
217 const relative = path.parse(path.relative(srcDir, chunk.facadeModuleId!));
218 const intermediate = path.join(declarationDir, relative.dir, `${relative.name}.d.ts`);
219 if (!fs.existsSync(intermediate)) {
220 this.error(`Could not find intermediate d.ts at ${intermediate}`);
221 }
222 const outFile = path.resolve(opts.dir!, fileName.replace(/\.mjs$/, '.d.ts'));
223 generateDts(projectDir, intermediate, outFile, externals);
224 }
225 }
226 });
227 };
228

Callers

nothing calls this directly

Calls 12

createApiDtsFilesFunction · 0.90
generateDtsFunction · 0.85
collectFunction · 0.85
replaceMethod · 0.80
warnMethod · 0.80
errorMethod · 0.65
infoMethod · 0.65
debugMethod · 0.65
keysMethod · 0.45
parseMethod · 0.45
joinMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected