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

Method saveAsset

packages/vite/src/node/plugins/worker.ts:83–96  ·  view source on GitHub ↗
(asset: WorkerBundleAsset, logger: Logger)

Source from the content-addressed store, hash-verified

81 }
82
83 saveAsset(asset: WorkerBundleAsset, logger: Logger) {
84 const duplicateAsset = this.assets.get(asset.fileName)
85 if (duplicateAsset) {
86 if (!isSameContent(duplicateAsset.source, asset.source)) {
87 logger.warn(
88 `\n` +
89 colors.yellow(
90 `The emitted file ${JSON.stringify(asset.fileName)} overwrites a previously emitted file of the same name.`,
91 ),
92 )
93 }
94 }
95 this.assets.set(asset.fileName, asset)
96 }
97
98 invalidateAffectedBundles(file: string) {
99 for (const [bundleInputFile, bundle] of this.bundles.entries()) {

Callers 2

saveWorkerBundleMethod · 0.95
workerFileToUrlFunction · 0.80

Calls 4

isSameContentFunction · 0.85
warnMethod · 0.65
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected