-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configurable bundles #3599
Comments
Hi @thekevinbrown, is this feature request still needed? It sounds like a very niche case that should be fixed within react-pdf. Regarding the |
There was a bunch of workarounds required to make this work: https://github.com/exogee-technology/vite-plugin-shim-react-pdf I still think it'd be useful to have the loading order of scripts in the production bundle the same as the dev bundle to minimise issues like this. |
The Vite plugin looks fine to me. It's intended to polyfill those nodejs modules manually if you use them. Re loading order, is it similar to #7264? You can configure rollupOptions if you need something specific in your bundle. So I think this feature is already covered today. Can you clarify if there's anything else not covered yet, and what's the desired API? |
Yup, that looks like a more concise version of what I'm asking for. I'll close this as a duplicate of #7264. |
Clear and concise description of the problem
global
and a few other things shimmed (e.g. react-pdf is not compatible without shims #3405)index.html
gets pulled into the user code bundle, which runs after the vendor bundle.Suggested solution
Allow us to configure this polyfill to be injected at the top of the vendor bundle.
I couldn't find a rollup plugin (or vite plugin for that matter) that would allow this arbitrary code to get injected in the vendor bundle.
Happy to do this however I need to. I'm running out of options, and am thinking of gross things like a postinstall script to inject this at the top of the package if I can't find a way to configure Rollup to inject it.
Alternative
I'm also working on fixing React PDF itself so it works properly in modern environments and doesn't need all these shims, but I'm really struggling to even get a dev environment with a running example up for that package, so it'll be slow going. I think it'd be nice to allow developers to configure these types of workarounds when needed for other packages that they can't change.
Additional context
N/A
The text was updated successfully, but these errors were encountered: