cra-universal
Create React App Universal CLI

Create React App companion for universal app. No eject, zero config with customization, supports string and node stream API
Live Demo | Official Doc
Features
- No eject needed!
- Zero config by default and customizable
- Server-side rendering for your SEO
- Code-splitting that works universally
- The core middleware is fully unit-tested
- Works alongside
react-scripts, not as replacement
Prerequisites
- Node >= 14.17.5 LTS recommended
- npx is required
Installation
create-react-app myapp
cd myapp
yarn add -D cra-universal
yarn add @cra-express/core express@4.18.1
Existing Projects
yarn add -D cra-universal
yarn add @cra-express/core express@4.18.1
yarn run cra-universal init
Client code change
Please update your render method on src/index.js
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
ReactDOM.hydrateRoot(document.getElementById('root'), <App />);
Development
npm start
npx cra-universal start
Production
npx cra-universal build
Deployment
- First, follow the Production guide mentioned above.
- Since the bundle used Webpack Node Externals, you need to run
npm install --production on the copied /dist, but this time you don't need to install its devDependencies
- Use process manager like PM2 to run your server, your run target is ./dist/server/bundle.js
Credit
Support
If you like this project, please kindly support it by becoming a patron at my Patreon page. Thanks!
Contributors
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals

Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License
MIT