davidmyersdev / vite-plugin-node-polyfills

A Vite plugin to polyfill Node's Core Modules for browser environments.
MIT License
263 stars 17 forks source link

use config warning handler if it exists #45

Closed derekdavenport closed 9 months ago

derekdavenport commented 9 months ago

plugin should use the existing configured warning handler if there is one.

for example using react-query causes many MODULE_LEVEL_DIRECTIVE warnings which are now suppressed by @vitejs/plugin-react. However, when also using the current version of this plugin, that suppression no longer works as it reverts to the default handler. This PR is based on the onwarn handler in the react plugin.

kayac-chang commented 9 months ago

I just ran into it too.

davidmyersdev commented 9 months ago

@derekdavenport this looks great! I appreciate you submitting a PR, and I'll get this into a release soon.

davidmyersdev commented 9 months ago

This has been released in v0.15.0.