(opts, bundle)
| 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 |
nothing calls this directly
no test coverage detected