Code Monkey home page Code Monkey logo

react-hot-boilerplate's Introduction

React Hot Boilerplate

High customizable production-ready React environment with live-editing. Live editing (webpack-dev-server and react-hot-loader) are included only when running in dev-server mode.

Installation

npm i

Usage (dev-server)

npm run dev-server
open http://localhost:8081
edit src/components/app.js

All the changes will appear without reloading the browser. build.js automatically adds hot-module to all entry points when running in dev-server mode.

Building

npm run build
bundle files will appear in ./public/assets/

Linting

This boilerplate includes React-friendly ESLint configuration with Airbnb style guideline. Eslint runs automatically on each build.

Profiling

npm --silent run profiler > profile
upload file to http://webpack.github.io/analyse/

Configuration

You can change build configuration in build.js

  • WEBPACK_ENTRY webpack entry point
  • PUBLIC_PATH public path for assets
  • CONTENT_BASE content base
  • SOURCE_PATH sources path
  • OUTPUT_JS output js name
  • OUTPUT_CSS output css name
  • OUTPUT_FONTS output fonts name
  • OUTPUT_MEDIA output media name
  • EXTRACT_CSS if true, css will be extracted into OUTPUT_CSS. if false - included into OUTPUT_JS

For example you want to change fonts public path from /assets/ to /assets/fonts/:

mkdir ./public/assets/fonts/
change OUTPUT_FONTS to ./fonts/[hash].[ext]

Proxying

To enable proxying requests (api, backend, etc) in dev-server mode you can change DEV_SERVER_PROXY_PORT and DEV_SERVER_PROXY_HOST in build.js.

Using 0.0.0.0 as Host

You may want to change the host DEV_SERVER_HOST in build.js from localhost to 0.0.0.0 to allow access from same WiFi network.

react-hot-boilerplate's People

Contributors

ferggren avatar

Watchers

 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.