-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Implement proper preact-ssr #767
Conversation
So, no need to define a custom .babelrc for the user.
Hiya @arunoda - I'd love to play around with this and see if I can run into (and thus fix) any issues with SSR. Would you be able to explain how you're testing this out? Am I right in thinking it's just this: git clone && npm i && cd examples/using-preact && npm i && npm start |
@developit Yep. That's it. |
@arunoda any plan to merge this? It seems like you're working on may PRs at a time |
@thangngoc89 this is marked for 2.1 release. |
This can be closed because of the new preact example. |
In the current version of preact, it only works(barely) in the client side. But in the server, it still using react.
So, this fixes that issue and improve the use of preact.
Here we've introduce a module alias system where it alias correctly in different places.(Node, webpack, babel)
Preact also doesn't work well with
react-hot-loader
. And we don't really need preact in the dev mode. So with this, we only run preact only in production.How to add preact as mentioned above?
Now it's pretty easy. Just create a config in
next.config.js
like this: