├── .babelrc ├── .gitignore ├── README.md ├── package.json ├── server.js ├── src ├── Counter.js └── main.js ├── webpack.config.js └── www └── index.html /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "react" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | www/bundle.js 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Minimal React Starter 2 | --- 3 | 4 | A starter project with [React](https://facebook.github.io/react/), [Babel](http://babeljs.io/), and [Webpack](http://webpack.github.io/). 5 | 6 | This starter is as minimal as possible while still including Babel and Webpack. 7 | 8 | 9 | Create Project 10 | --- 11 | ``` 12 | git clone git@github.com:ahfarmer/minimal-react-starter.git 13 | ``` 14 | 15 | 16 | 17 | Setup 18 | --- 19 | 20 | ``` 21 | npm install 22 | ``` 23 | 24 | 25 | 26 | Usage 27 | --- 28 | 29 | 1. `node server.js` 30 | 31 | 2. Open [http://localhost:3000/](http://localhost:3000/). 32 | 33 | 34 | 35 | Build it from Scratch 36 | --- 37 | Starter projects can be difficult for beginners to use because of all the moving pieces. To help you understand this starter project, there is a [7-step walkthrough](http://andrewhfarmer.com/build-your-own-starter/) showing how to create it from scratch. 38 | 39 | 40 | 41 | Why Minimal? 42 | --- 43 | The primary purpose of this project is **learning.** 44 | 45 | For **learning**, a minimal starter project is best. Too many dependencies can cause confusion for a beginner. The process of selecting and adding what you need to a minimal project can be a good way to learn. 46 | 47 | 48 | 49 | Why not more Minimal? 50 | --- 51 | Babel and Webpack are the two tools that I view as completely essential in a React project. 52 | 53 | There are no other tools that I have used consistently in every single React project that I have built, no matter how large or how small. 54 | 55 | **Babel:** Even if you are just writing a quick test, you will likely want to use JSX in your components rather than writing out `React.createElement` over and over. 56 | 57 | **Webpack:** Webpack serves as both the web server and the JavaScript bundler. The only alternative to using a bundler would be to include a ` 4 | 5 |
6 | 7 | 8 |