Skip to content

fix!: use inject plugin instead of esbuild.banner#152

Open
sapphi-red wants to merge 1 commit intodavidmyersdev:mainfrom
sapphi-red:fix/use-inject-plugin-instead-of-esbuild-banner
Open

fix!: use inject plugin instead of esbuild.banner#152
sapphi-red wants to merge 1 commit intodavidmyersdev:mainfrom
sapphi-red:fix/use-inject-plugin-instead-of-esbuild-banner

Conversation

@sapphi-red
Copy link
Contributor

Alternative to #149.
This part of change does not make sense to me.
https://github.com/davidmyersdev/vite-plugin-node-polyfills/pull/149/changes#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R242-R246
jsxInject is only used for JSX / TSX files but we need to inject these in JS / TS files as well.

This PR changes the plugin to use transform hook to inject variables in both dev and build. Since the transform hook needs enforce: 'post' and the other hooks doesn't want enforce to be specified, the plugin now returns Plugin[]. This is technically a breaking change, but users won't need to change there config unless they are using Vite 2.x.

close #142

@sapphi-red sapphi-red changed the title fix: use inject plugin instead of esbuild.banner fix!: use inject plugin instead of esbuild.banner Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant