(_options, bundle)
| 59 | }, |
| 60 | buildEnd(error) { if (error) failed = true; }, |
| 61 | generateBundle: { order: 'post', handler(_options, bundle) { |
| 62 | for (const id of this.getModuleIds()) { |
| 63 | const info = this.getModuleInfo(id); |
| 64 | if (info?.isExternal) externals.add(id); |
| 65 | else modules.add(record(id) ?? id); |
| 66 | } |
| 67 | for (const path of this.getWatchFiles()) record(path); |
| 68 | for (const [name, output] of Object.entries(bundle)) { |
| 69 | if (output.type === 'chunk') chunks.add(name); |
| 70 | else if (name === 'index.html' || name.endsWith('.css')) { |
| 71 | // Only bundler outputs qualify. Files copied from public never |
| 72 | // enter this hook; record bytes before inspecting the dist tree. |
| 73 | generatedAssets[name] = createHash('sha256').update(output.source).digest('hex'); |
| 74 | } |
| 75 | } |
| 76 | } }, |
| 77 | closeBundle() { |
| 78 | if (worker || failed || !existsSync(outDir)) return; |
| 79 | const outputs: Record<string, string> = {}; |
no test coverage detected