-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add support for creating a preact-compat build #124
Comments
You are a gentleman and a scholar. |
- react and react-dom are aliased to preact-compat in Webpack config - Incompatible Babel transforms for React production optimisations are excluded from Babel config Closes #124
@developit is there anything in the code in the Gist below which would specifically be incompatible with preact-compat? https://gist.github.com/insin/45b7f66e01628601c0cc6b79767b0e4f#file-app-js Trying the |
@insin Sorry for the delay - use |
👍 got it working, but I had to fiddle with "peerDependencies": {
"preact": "* || ^5.1.0-beta.20",
"proptypes": "*"
},
"dependencies": {
"preact-render-to-string": "^2.6.1",
"preact-svg": "^1.6.0"
}, A dependency should usually be in either |
Ah totally yeah, I need to remove it from optionalDependencies. Will try to tonight. Though I'm likely release preact 5 as the new mainline this week so the problem should go away. |
@insin Removed optionalDependencies from |
@developit's preact-compat is a drop-in way to try preact with a React app - if it's compatible with your app, having support for it in react-specific build commands would be an easy way to shave size off your production build.
The actual change here should be making the following tweaks to build-react-app.js and build-react.js:
--preact
flag is present, add thisresolve.alias
config to the base Webpack config--preact
flag is present, don't configure React inline and constant element transforms for production buildsThe text was updated successfully, but these errors were encountered: