The vite plugin's reach is publicDir copies only: buildStart globs config.publicDir and takes the fragments, closeBundle overwrites outDir/<same relative path> (overwrite-only, never create — by design, so files a consumer's build deliberately removed stay removed).
Consequence: any asset that goes through the bundler itself — imported via an alias, emitted by Rollup/Vite as a hashed type: 'asset' file — is out of reach in principle. The hash renames the file but does not touch its bytes; it ships as a fully openable image. Consumers cannot fix this from outside the plugin.
Proposal: an opt-in that extends cutting to bundle output — in generateBundle, iterate emitted type: 'asset' files (filtered by the same include/exclude semantics), cut their headers, and key the fragment map by the emitted filename so the runtime can find the body it actually fetches.
Structurally this is the biggest coverage gap in the current design: everything else (formats, release APIs) refines what the plugin already reaches; this one decides what it can reach at all.
The vite plugin's reach is
publicDircopies only:buildStartglobsconfig.publicDirand takes the fragments,closeBundleoverwritesoutDir/<same relative path>(overwrite-only, never create — by design, so files a consumer's build deliberately removed stay removed).Consequence: any asset that goes through the bundler itself — imported via an alias, emitted by Rollup/Vite as a hashed
type: 'asset'file — is out of reach in principle. The hash renames the file but does not touch its bytes; it ships as a fully openable image. Consumers cannot fix this from outside the plugin.Proposal: an opt-in that extends cutting to bundle output — in
generateBundle, iterate emittedtype: 'asset'files (filtered by the same include/exclude semantics), cut their headers, and key the fragment map by the emitted filename so the runtime can find the body it actually fetches.Structurally this is the biggest coverage gap in the current design: everything else (formats, release APIs) refines what the plugin already reaches; this one decides what it can reach at all.