React Vite remote + Webpack Host #421
Replies: 4 comments
-
The detailed reason is that I can't guarantee that multiple packaging tools have consistent exports, so you can understand that vite in dev mode will use esbuild packaging library, serve mode will use rollup, webpack are using their own written code packaging |
Beta Was this translation helpful? Give feedback.
-
To be precise, this sentence is incomplete, not only react, as long as it is the shared library of the CJS specification, there will be this problem. |
Beta Was this translation helpful? Give feedback.
-
#413 (comment) |
Beta Was this translation helpful? Give feedback.
-
@ruleeeer Super insightful and as I dug more thats kinda what I was finding, though I was having a hard time reasoning why it was React only problem. Seems like if you add some heavy config to Webpack to enable ESM to be consumed this can be worked around. This demo videois pretty helpful on seeing it come together. Though this feels pretty hacky anyway. After chatting through it with my team we basically landed on just keep the tooling the same on host and remote. Trying to do a bunch of fancy stuff to get differing tooling to agree on modules just leads to more of a headache. Seems like you've arrived at the same position. Appreciate the response 👍 |
Beta Was this translation helpful? Give feedback.
-
I saw that in the README, there is a line:
I would love to know more about this. What is actually happening under the hood that causes this issue with React apps in particular? Is there any way that we can add config to make the packaging process more consistent?
handshake between Vite and Webpack is a major usecase for our app and so being able to unlock this functionality without changing the Host app (Webpack) would be ideal.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions