Git Product home page Git Product logo

react-webpack-template's Introduction

react-webpack-boilerplate, react + webpack模版

包含了热重载、eslint代码检查、单元测试的webpack模版,A full-featured Webpack setup with hot-reload, lint-on-save & unit testing.

该模版基于react16版本和webpack4, This template is react16 compatible.

Usage

This is a project template for react

$ clone https://github.com/feleventh/react-webpack-template.git
$ cd react-webpack-template
$ yarn install
$ npm run dev

The development server will run on port 8081 by default. If that port is already in use on your machine, the next free port will be used.

What's Included

  • npm run dev: first-in-class development experience.

    • State preserving hot-reload
    • State preserving compilation error overlay
    • Lint-on-save with ESLint/airbnb-base
    • Source maps
  • npm run build: Production ready build.

    • JavaScript minified with UglifyJS v3.
    • HTML minified with html-minifier.
    • CSS across all components extracted into a single file and minified with cssnano.
    • Static assets compiled with version hashes for efficient long-term caching, and an auto-generated production index.html with proper URLs to these generated assets.
    • Use npm run build --reportto build with bundle size analytics.
  • npm run unit: Unit tests run in JSDOM with Jest.

    • Supports ES2015+ in test files.
    • Easy mocking.

Fork It And Make Your Own

该模版项目默认使用了airbnb代码风格,你也可以修改为standard或者其他js代码风格,单元测试使用了Jest框架,你也可以选择mocha+karma等其他测试框架。

欢迎fork,star本项目,并在issues提出宝贵建议。

You can fork this repo to create your own boilerplate

react-webpack-template's People

Contributors

feleventh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.