MCPcopy
hub / github.com/vitejs/vite / removeBundle

Method removeBundle

packages/vite/src/node/plugins/worker.ts:113–129  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

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)

Callers 1

Calls 4

getHashFunction · 0.90
deleteMethod · 0.80
hasMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected