|
| 1 | +# React Configuration |
| 2 | + |
| 3 | +Configuration for a react app. |
| 4 | + |
| 5 | +Uses Webpack 4, Babel 7 |
| 6 | + |
| 7 | +## Quick Overview |
| 8 | +* `git clone --depth 1` this repository to get started. |
| 9 | +* `npm install` to install needed dependencies. |
| 10 | +* `npm start` to start the application on port 3002 |
| 11 | +* `npm build` to build the application. |
| 12 | + |
| 13 | +You can replace these with their `yarn` counterparts, if you prefer. |
| 14 | + |
| 15 | +## Features |
| 16 | +* ### [POSTCSS Plugins](http://postcss.org/) |
| 17 | + * [Preset ENV CSS](https://preset-env.cssdb.org) |
| 18 | + |
| 19 | + Write future CSS today. Better than using Preprocessors like SASS or LESS because it's pure CSS that you learn. |
| 20 | + |
| 21 | + Comes with *autoprefixer* for your styles. |
| 22 | + |
| 23 | + * [Stylelint](https://stylelint.io/) |
| 24 | + |
| 25 | + Get a whole lot better stylelinting than ESLint. |
| 26 | + |
| 27 | + Follows https://github.com/stylelint/stylelint-config-standard for linting. |
| 28 | + Turn rules on or off from `.stylelintrc.json` file. |
| 29 | + |
| 30 | + * [PostCSS Normalize](https://www.npmjs.com/package/postcss-normalize) |
| 31 | + |
| 32 | + Normalize stylesheets based on browser support for browserlist. |
| 33 | + |
| 34 | +* ### [ESLint](https://eslint.org) |
| 35 | + Follows [Airbnb Javascript Style Guide](https://github.com/airbnb/javascript). You can turn rules on or off from `.eslintrc.json`. You can choose to ignore files on whole from `.eslintignore` |
| 36 | + |
| 37 | + Note: ESLint has it's style formatting options turned off by default, because it is handled by `Prettier` later on. |
| 38 | + |
| 39 | +* ### [Babel](https://babeljs.io/) |
| 40 | + Used to compile your modern javascript to es2015 compatible javascript. |
| 41 | + You can change the configuration with .babelrc file. |
| 42 | + |
| 43 | +* ### [Prettier](https://github.com/prettier/prettier) |
| 44 | + Formats code in place, so you don't have to learn the styling rules. |
| 45 | + |
| 46 | +* ### [UglifyJS](https://github.com/mishoo/UglifyJS2) |
| 47 | + Used to minify, mangle and compress javascript code. |
| 48 | + Used only during production. |
| 49 | + |
| 50 | +* ### [Workbox](https://developers.google.com/web/tools/workbox) |
| 51 | + Generates an optimised service worker with support for precaching and offline loading. |
| 52 | + |
| 53 | +* ### Unit Testing |
| 54 | + Unit testing setup using [Jest](https://facebook.github.io/jest/). Shallow rendering support with [Enzyme](http://airbnb.io/enzyme/) |
| 55 | + |
| 56 | +## Other enhancements |
| 57 | +1. Code split into `vendor.js` and hashed javascript filenames. |
| 58 | +This helps in pushing new code without worrying about caching issues. |
| 59 | +2. Webpack automatically looks for and installs plugins that are not installed by default. |
| 60 | +Just import the required library and let webpack worry about installing it. |
| 61 | + |
| 62 | + https://github.com/webpack-contrib/npm-install-webpack-plugin |
| 63 | +3. Extracts CSS to a new file and minifies it. |
| 64 | + |
| 65 | + https://github.com/webpack-contrib/extract-text-webpack-plugin |
| 66 | + |
| 67 | +4. Minifies react and react-dom packages. |
| 68 | + |
| 69 | + https://facebook.github.io/react/docs/optimizing-performance.html#webpack |
| 70 | +5. Removes debugging consoles for Production build |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +_Feel free to throw in a pull request._ |
| 75 | + |
| 76 | + |
| 77 | + |
0 commit comments