preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
950 stars 148 forks source link

preact-compat for third-party package #532

Closed firegnu closed 5 years ago

firegnu commented 5 years ago

I use preact&&preact-compat in my project and have alias in my webpack config file. But some third-party package use react as well. So, The node_modules react third-party package will continue use react or preact&&preact-compat? I want third-party package use preact as well. what should i do? thanks

marvinhagemeister commented 5 years ago

Since you already have set up webpack with aliases to preact-compat your bundle will not contain the react package. This will be true for any package you include in the bundle, regardless of whether they were coming from node_modules or your own path. React will be present in node_modules though, because npm doesn't read the webpack config and doesn't understand aliases.

firegnu commented 5 years ago

So, the third-party library will use the preact as well?

marvinhagemeister commented 5 years ago

yup 👍