Closed zsolt-dev closed 3 years ago
Package aliases can end up failing to apply to dependencies that specify specific react versions. The recommended solution is to use both techniques - alias using npm aliases, then also alias in your bundler config.
For SSR, you can use module-alias, which works directly in Node.
Hi,
When I alias preact-compat in webpack config, I get warnings in VS code and it does not work without webpack...
Now, there is new way to alias packages directly in npm: https://github.com/npm/rfcs/blob/latest/implemented/0001-package-aliases.md
Could this work for aliasing preact-compat as react and react-dom?
If yes, maybe this should be the preferred way in the documentation.
EDIT: the webpack alias does not work for me, since I do SSR and do not have webpack on the server side.
Thank you