All Projects → SidKwok → Template Rwb

SidKwok / Template Rwb

Licence: mit
A full-featured Webpack setup with hot-reload

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Template Rwb

React Redux Universal Boilerplate
An Universal ReactJS/Redux Boilerplate
Stars: ✭ 165 (+0%)
Mutual labels:  webpack, boilerplate, hot-reload, react-router
React Pages Boilerplate
Deliver react + react-router application to gh-pages
Stars: ✭ 134 (-18.79%)
Mutual labels:  webpack, boilerplate, hot-reload, react-router
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (-14.55%)
Mutual labels:  webpack, boilerplate, react-router
Node Hot Loader
Hot module replacement (hot reload) for Node.js applications. Develop without server restarting.
Stars: ✭ 111 (-32.73%)
Mutual labels:  webpack, hmr, hot-reload
React Redux Styled Hot Universal
react boilerplate used best practices and focus on performance
Stars: ✭ 147 (-10.91%)
Mutual labels:  webpack, boilerplate, react-router
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-43.03%)
Mutual labels:  webpack, hmr, react-router
Molecule
⚛️ – :atom: – ⚛️ Boilerplate for cross platform web/native react apps with electron.
Stars: ✭ 95 (-42.42%)
Mutual labels:  webpack, hot-reload, react-router
Js Stack Boilerplate
Final boilerplate code of the JavaScript Stack from Scratch tutorial –
Stars: ✭ 145 (-12.12%)
Mutual labels:  webpack, boilerplate, react-router
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-80.61%)
Mutual labels:  webpack, boilerplate, react-router
Reeakt
A modern React boilerplate to awesome web applications
Stars: ✭ 116 (-29.7%)
Mutual labels:  webpack, hmr, react-router
React Redux Auth0 Kit
Minimal starter boilerplate project with CRA, React, Redux, React Router and Auth0 authentication
Stars: ✭ 115 (-30.3%)
Mutual labels:  webpack, boilerplate, react-router
React Redux Graphql Apollo Bootstrap Webpack Starter
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter
Stars: ✭ 127 (-23.03%)
Mutual labels:  webpack, boilerplate, react-router
React Dashboard
🔥React Dashboard - isomorphic admin dashboard template (React.js, Bootstrap, Node.js, GraphQL, React Router, Babel, Webpack, Browsersync) 🔥
Stars: ✭ 1,268 (+668.48%)
Mutual labels:  webpack, hmr, react-router
Starter Lapis
Cutting edge starter kit
Stars: ✭ 72 (-56.36%)
Mutual labels:  webpack, boilerplate, react-router
Awesome Chrome Extension Boilerplate
Use react + typescript + webpack to enhance your chrome extension development experience
Stars: ✭ 146 (-11.52%)
Mutual labels:  webpack, boilerplate, hot-reload
React Cool Starter
😎 🐣 A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices.
Stars: ✭ 1,083 (+556.36%)
Mutual labels:  webpack, boilerplate, react-router
Sass Vars Loader
Use Sass variables defined in Webpack config or in external Javascript or JSON files
Stars: ✭ 112 (-32.12%)
Mutual labels:  webpack, hmr, hot-reload
React Webpack Typescript Starter
Minimal starter with hot module replacement (HMR) for rapid development.
Stars: ✭ 632 (+283.03%)
Mutual labels:  webpack, hmr, boilerplate
React Ssr Setup
React Starter Project with Webpack 4, Babel 7, TypeScript, CSS Modules, Server Side Rendering, i18n and some more niceties
Stars: ✭ 678 (+310.91%)
Mutual labels:  webpack, hmr, react-router
Universal React Redux
🧐 A sensible universal starter kit for React + Redux
Stars: ✭ 112 (-32.12%)
Mutual labels:  webpack, hot-reload, react-router

react-webpack-boilerplate

node React Redux webpack MIT

A SPA boilerplate with React, built with love.

Features

  • React 16.6.3
  • Redux 4.0.0
  • react-redux, to bind React and Redux.
  • react-router v4 or v3, choose the one you are familiar with.
  • JSX
  • ES6, babel7, use babel-polyfill to make things work, support decorators by default.
  • CSS Modules, support CSS Modules,off by default
  • webpack 4.x, support node 6 and above
  • Code-Spliting, async components, and even async css.
  • Hot-Reload, support both React and Redux!
  • Proxy
  • Environmental value
  • ESlint, with standard and standard-react.
  • Redux-devtools, to make the stores more clear.
  • bundle-analyzer
  • jest with Enzyme, to make unit test for react components easier.

Usage

# install sao first
npm install -g sao

# download the template
# via npm (recommanded)
sao rwb new-project -u

# via github
sao SidKwok/template-rwb new-project -u

# install all this dependencies.
cd new-project
npm install

# development, default port: 8080
npm run dev

# production
npm run build

# build with report
npm run build --report

# lint the files (if use eslint)
npm run lint

# run all tests
npm test

Doc

It's pretty much the same config as vue-cli/webpack. If you are familiar with vue-cli, you may have a great joy with this boilerplate. If you want to have a peek of the structure, you can visit full-features branch.

Pre-Processor

You can take less, sass, or stylus as your CSS pre-processors, after installing the dependencies. For example, to use less:

npm install less less-loader --save-dev

Then, you can import your less files in your components.

postcss-config

We use postcss with autoprefixer by default. You can also use your own plugins in the project. For example, to use postcss-color-gray to "grayify" your color:

# First thing to do
npm install postcss-color-gray --save-dev

add your plugin in postcssrc.js

module.exports = {
  "plugins": {
    // to edit target browsers: use "browserlist" field in package.json
    "autoprefixer": {},
    // put your plugin here
    "postcss-color-gray": {}
  }
}

Tada! Everything is gray now.

Proxy

We uses http-proxy-middleware for proxying. For example, you want to proxy /api/get-post and /api/get-id, you can edit the option in config/index.js:

...
dev: {
  proxyTable: {
    '/api': {
      target: 'http://example.org',
      changeOrigin: true
    }
  }
}
...

Then, you can proxy /api in your dev server. See more options.

Env

This doc can illustrate the usage well.

Hot-Reload

We use react-hot-loader v4 to tweak React components, even for Redux! Have fun!

CSS Modules

The template support CSS Modules,you can turn it on in config/index.js: cssModules.

ESlint

standard and standard-react are the default style guides for this boilerplate, feel free to edit your own config in .eslintrc.js.

Router

You can use v3 or v4 as your router, and both of them support async router! We use React.lazy to split router into several chunk.

Redux

You can use Redux in the project when you enable the choice. Noted that we separate two kinds of store(dev and prod) in two files. The prod one doesn't have any devtools' code, for reducing the size of bundle. If you need to apply the middlewares (redux-thunk, redux-saga and so on), you need to apply them in middlewares.js.

redux-devtools

This boilerplate has enabled the browser devtool config for Redux automatically. To make it work, you need to download the extension for your browser.

You can also choose Customized DevTools that built in your page. With this you can customized your own devtool. Click here to see more options.

Production

The production files built for server, so you are not supposed to visit index.html directly. To make it works, you may need a static server:

npm install -g serve # or others

# in `./dist`.
serve

# if you enable router
serve -s

We use babel-plugin-transform-react-remove-prop-types to remove PropType from production bundle.

bundle-analyzer

We analyze the bundle content with webpack-bundle-analyzer:

bundle-analyzer

To get this out, please run:

npm run build --report

Source Map

You can have a better experience on debugging with sourceMap in your development, but we disable it by default in production for others are not supposed to get your source code from the browser. It also can make your building process faster. Feel free to turn it on in config/index.js: productionSourceMap.

Unit test with jest

We provide jest as the default unit test library for its powerful and convenient apis. We also use Enzyme as a helper to make components more testable. All test files should place in ./test/unit/__tests__. And you need to create the files named your-js(x)-file.test.js, or it will not pass in jest. But you can set your own rules in package.json.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].