/webpack-react-boilerplate

A boilerplate for using webpack and react.

Primary LanguageJavaScriptISC LicenseISC

Webpack+React+Babel+Sass

It took me several days to learn and assemble these pieces, so this boilerplate can save others time.

DEPRECATED: Use parcel-react-boilerplate instead.

Usage

  1. Install Node.js and Git

  2. Download the repository

    git clone https://github.com/J-F-Liu/webpack-react-boilerplate.git
    cd webpack-react-boilerplate
    
  3. Checkout react-router branch if you want to use react-router

    git checkout react-router

  4. Install npm packages

    npm install

  5. Start dev server

    npm start

  6. Build website for production enviroment

    npm run build

View online demo.
View online demo with react-router.

Trouble shooting

ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax=true!./app/styles/site.sass
Module build failed: Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (51)

or

ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax=true!./app/styles/site.sass
Module build failed: Error: ENOENT: no such file or directory, scandir

Run npm rebuild node-sass.

When using Microsoft Windows, install Python 2.7 and Visual C++ Build Tools, then run

npm install node-sass --msvs_version=2015
npm rebuild node-sass