This project is Razzle boilerplate for React Server Side Rendering.
To start using this project :
git clone https://github.com/finmavis/razzle-boilerplate.git
- Navigate to folder you just clone
- Install all Dependencies,
yarn
ornpm install
- Then for development just run the script
yarn start
ornpm run start
- To build production just run the script
yarn build
ornpm run build
, it will generate folder build. - To serve Production just run the script
yarn start:prod
ornpm run start:prod
- Server Side Rendering (thanks to Razzle)
- SEO Friendly (Thanks to React Helmet)
- Code Splitting (Thanks to @loadable/component)
- Remove unused CSS on
Production build
(Thanks to PurgeCSS) - Static type system and a linter using Eslint and Prettier
- Pre-commit hooks using Husky and Lint Staged
- Compression using Brotli and fallback to Gzip (Thank to Razzle Plugin Compression)
- Disable
source maps
CSS and JS onProduction build
(Thanks to Razzle Plugin Disable Source Maps Production) - Optimized images on
Production build
(Thanks to Imagemin Webpack)
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
Runs the compiled app in production.
You can again view your application at http://localhost:3000
To check javascript linting rules.
To check javascript linting rules and automatic fix if possible.
To check codebase using Prettier
rules.
To format or prettier codebase using Prettier
To check Javascript Linting
and Prettier
rules on Codebase
By default, the generated project supports all modern browsers. Support for Internet Explorer 9, 10, and 11 requires polyfills. If you still need to support these browsers, follow the instructions below.
-
Install react-app-polyfill:
npm install react-app-polyfill
oryarn add react-app-polyfill
-
place one of the following lines at the very top of src/client.js:
import 'react-app-polyfill/ie9'; // For IE 9-11 support import 'react-app-polyfill/ie11'; // For IE 11 support