Skip to content

velopert/react-webpack2-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-webpack2-skeleton

React-webpack2-skeleton is a Universal React boilerplate that uses Webpack2.

Features

  • Webpack2 with url-loader, sass-loader, css-loader, babel-loader
  • react-hot-loader@3.0.0
  • react-router@4.0.0
    • Code splitting
    • Server rendering with express
  • redux
    • Duck structure is used in this project
    • Async actions are handled by redux-promise-middleware
    • ImmutableJS is used in the reducers
    • transit-immutable-js is used to serialize / deserialize the Immutables

NOTE:

Babel configuration is same as create-react-app
Code splitting only works in production mode

Requirement

  • Node ^6.0.0
  • yarn ^0.20.0 or npm ^3.0.0

Getting started

First, clone the project:

$ git clone https://github.com/velopert/react-webpack2-skeleton.git <project-name> $ cd <project-name>

Branches

Just in case you do not need some features, different branches are provided in this project.

Branch Description
light Pure react project environment with SCSS loader
hmr React-hot-loader
router React-router, server render, code-splitting
$ git checkout <branch>

Then, install the dependencies. It is recommended to use Yarn, (because it is blazing fast). You can still use npm as well.

$ yarn install # or npm install

Script usage

You can execute the scripts below by yarn run <script> or npm run <script>.

Command Description
start:dev Starts webpack development server; served at localhost:3000
start Starts production server; served at localhost:8080
build Bundles the source in ~/build directory
build:server Bundles the source to server renderer in ~/server directory

Directory structure

- config # webpack configuration files - public # directory for index.html - server # server render - src # application source code ----- components # directory for presentational components ----- containers # directory for container components ----- styles # directory for appliaction styles (in scss format) --------- base # global styles --------- components # styles for each components 

About

Get started with React with Webpack2, React-Router, Redux, Code Splitting and Server Rendering

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published