That's what esbuild did for their plugins—which made them useless since it kills any performance gains of switching to esbuild in the first place
Setting this up takes a bit more work than for webpack, and it's easier to run into limits on what's reasonably possible, but I don't intend to ever go back.