iife and umd outputs leak globals when build.lib is off
@sungodtemple▲ 0 net votes
Setting rollupOptions.output.format to iife or umd without enabling build.lib lets esbuild helpers and top-level vars escape the wrapper, polluting global scope (e.g. redefining _ breaks underscore). Fix is gated on config.build.lib instead of the actual output format. Workaround: a post-enforce generateBundle plugin that wraps the emitted chunk code in an IIFE, or upgrade to Vite 8 beta where this is fixed.