The package publishes an entry point per bundler through unplugin, and only /esbuild does anything. The rest produce a plugin with a name and an enforce and no hook that could run the cleanup, because the factory returns its work under the esbuild key, which only the esbuild adapter reads.
/nuxt and /astro are hand-written here and delegate to /vite and /webpack, so they inherit the same nothing.
These are in the exports map, so they can be imported. What they cannot do is have an effect, which is why removing them breaks nobody: an import that does nothing cannot be depended on.
Making them work is possible instead. unplugin's writeBundle is a generic hook every bundler receives, and it fires after output is written. It takes no arguments though, so the output directory and the set of built files would each have to come from somewhere per bundler. That is a real feature, and it would mean deleting files under bundlers this plugin has never been run against.
The readme already says these do nothing rather than showing a vite example that never removed a file, so this closes the gap rather than the confusion.
The package publishes an entry point per bundler through unplugin, and only
/esbuilddoes anything. The rest produce a plugin with a name and anenforceand no hook that could run the cleanup, because the factory returns its work under theesbuildkey, which only the esbuild adapter reads./nuxtand/astroare hand-written here and delegate to/viteand/webpack, so they inherit the same nothing.These are in the exports map, so they can be imported. What they cannot do is have an effect, which is why removing them breaks nobody: an import that does nothing cannot be depended on.
Making them work is possible instead. unplugin's
writeBundleis a generic hook every bundler receives, and it fires after output is written. It takes no arguments though, so the output directory and the set of built files would each have to come from somewhere per bundler. That is a real feature, and it would mean deleting files under bundlers this plugin has never been run against.The readme already says these do nothing rather than showing a vite example that never removed a file, so this closes the gap rather than the confusion.