Coder Social home page Coder Social logo

react-webpack-babel's Introduction

react-webpack-babel

Simple React Webpack Babel Starter Kit

Tired of complicated starters with 200MB of dependencies which are hard to understand and modify?

Try this is a simple React, Webpack and Babel application with nothing else in it.

What's in it?

  • Simple src/index.jsx and src/index.css (local module css).
  • Webpack configuration for development (with hot reloading) and production (with minification).
  • CSS module loading, so you can include your css by import styles from './path/to.css';.
  • Both js(x) and css hot loaded during development.

To run

  • You'll need to have git and node installed in your system.
  • Fork and clone the project:
> $ git clone THIS_REPO_URL
  • Then install the dependencies:
> $ npm install
  • Run development server:
> $ npm start

Open the web browser to http://localhost:8888/

To build production package

> $ npm run build

Nginx Config

Here is the suggested Nginx config:

server {
	# ... root and other options

	gzip on;
	gzip_http_version 1.1;
	gzip_types text/plain text/css text/xml application/javascript image/svg+xml;

	location ~ \.html?$ {
		expires 1d;
	}

	location ~ \.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {
		access_log off;
		log_not_found off;
		expires max;
	}
}

Eslint

There is a .eslint.yaml config for eslint ready with React plugin. To use it, you need to install additional dependencies though:

> npm install --save-dev eslint eslint-plugin-react

To do the actual linting, run:

> npm run lint

Notes on importing css styles

  • styles having /src/ in their absolute path are considered part of the application and exported as local css modules.
  • styles having /node_modules|global/ in their absolute path are considered global styles used by many components and are included in the css bundle directly.

Contribute

Please contribute to the project if you think this can be done better in anyway even for this README :)

react-webpack-babel's People

Contributors

alicoding avatar greenkeeperio-bot avatar k3a avatar michaelknoch avatar jikkujose avatar connor11528 avatar pavds avatar leoromanovsky avatar mrienstra avatar radek-novak avatar duncanchen avatar holmesal avatar daannijkamp avatar hugodias avatar yahkob avatar dabit3 avatar httpete-ire avatar thiagoxvo avatar

Watchers

fulong 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.