Skip to content

maxmarinich/react-redux-hmr-ssr

Repository files navigation

React Redux HMR SSR

Isomorphic web app boilerplate.

This is a simple boilerplate for web development built on React and Redux , containing modern web development tools:

Previous version

  • v1.0.0 is here (React Router Redux, Express ...)

Goals

  • Isomorphic App - application that can run both client-side and server-side.
  • Hot Module Reloading - replaces modules that have been changed in real time while preserving the state.
  • Server Side Rendering - renders pages on the initial stage for fast page loads and search engine optimization.
  • Code Splitting - split code into bundles so that code is asynchronously loaded by the client.
  • Development / Production Mods.

How to use

clone the project
git clone https://github.com/maxmarinich/react-redux-hmr-ssr.git

Note

  • To avoid errors, connect css modules something like as follows (with the file extension specifying):
  // for .js files
  
  import './styles/index.sass'
  import 'styles/index.sass' // if use aliases   
  
  // for .scss|sass files
  
  @import('./styles/index.sass')   
  @import ('~styles/index.sass') // if use aliases
  
install dependencies
npm i
run

For Development (HMR, SSR)

If nodemon not installed (for dev only)

npm i nodemon -g
npm start

else

npm start

For Production (SSR)

npm run start:prod