You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to use parcel with preact-compat because it requires being able to alias all references to 'react' and 'react-dom' to 'preact-compat'. It is possible to do this for local package using browser in package.json, but does not work when including external React components.
Which would then replace all references to react with preact-compat etc.
😯 Current Behavior
Using browser field, I can replace local import/requires successfully, but when importing, say react-apollo, it doesn't replace there.
🔦 Context
I know there was an issue #25 for this but it got locked and I haven't seen any further discussion about it, but this is quite inconvenient for people trying to use preact. I think it was a bad decision to completely delete all discussion about current workarounds as now people have no reference on what to do until this gets implemented natively.
Workaround for now
The workaround I found is to make symbolic links in the node_modules folder so that node_modules/react and node_modules/react-dom both link to node_modules/preact-compat.
The text was updated successfully, but these errors were encountered:
It is impossible to use parcel with preact-compat because it requires being able to alias all references to 'react' and 'react-dom' to 'preact-compat'. It is possible to do this for local package using
browser
inpackage.json
, but does not work when including external React components.🤔 Expected Behavior
Add an alias field in, say,
package.json
, likeWhich would then replace all references to
react
withpreact-compat
etc.😯 Current Behavior
Using
browser
field, I can replace local import/requires successfully, but when importing, sayreact-apollo
, it doesn't replace there.🔦 Context
I know there was an issue #25 for this but it got locked and I haven't seen any further discussion about it, but this is quite inconvenient for people trying to use preact. I think it was a bad decision to completely delete all discussion about current workarounds as now people have no reference on what to do until this gets implemented natively.
Workaround for now
The workaround I found is to make symbolic links in the
node_modules
folder so thatnode_modules/react
andnode_modules/react-dom
both link tonode_modules/preact-compat
.The text was updated successfully, but these errors were encountered: