unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more
https://unplugin.unjs.io
MIT License
3.02k stars 109 forks source link

rspack plugin transform includes everything #328

Closed JasonBoy closed 8 months ago

JasonBoy commented 1 year ago

Environment

unplugin@1.4

Reproduction

When add plugins of unplugin to rspack like unplugin-auto-import/rspack, the non-js files like static assets will broken

Describe the bug

like the fonts below which has different size before and after bundle, which also not recognized in browser, looking at the code in https://github.com/unjs/unplugin/blob/main/src/rspack/index.ts#L44 , it includes everything in the transform, also not accept outside options for include, maybe this is because the rspack is still in experimental state, is there any est for rspack plugin updates? or any workarounds? I found the unplugin has the rspack(compiler){} hook when createUnplugin(), but the plugins like unplugin-auto-import did not use it, or from the userOptions.

image

Additional context

No response

Logs

No response

JasonBoy commented 8 months ago

fixed in #354