posth / react-youtube

YouTube Favorites listings player app [react-redux]
MIT License
0 stars 0 forks source link

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?

To run

git clone https://github.com/alicoding/react-webpack-babel.git
npm install
npm start
npm run dev

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

To build the production package

npm run build

Nginx Config

Here is an example 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 / {
        try_files $uri $uri/ /index.html;
    }

    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

Contribute

Please contribute to the project if you know how to make it better, including this README :)