(file: string)
| 111 | } |
| 112 | |
| 113 | private removeBundle(file: string) { |
| 114 | const bundle = this.bundles.get(file) |
| 115 | if (!bundle) return |
| 116 | |
| 117 | this.bundles.delete(file) |
| 118 | this.fileNameHash.delete(getHash(bundle.entryFilename)) |
| 119 | |
| 120 | this.assets.delete(bundle.entryFilename) |
| 121 | |
| 122 | const keptBundles = [...this.bundles.values()] |
| 123 | // remove assets that are only referenced by this bundle |
| 124 | for (const asset of bundle.referencedAssets) { |
| 125 | if (keptBundles.every((b) => !b.referencedAssets.has(asset))) { |
| 126 | this.assets.delete(asset) |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | getWorkerBundle(file: string) { |
| 132 | return this.bundles.get(file) |
no test coverage detected