├── .gitignore ├── .babelrc ├── index.js ├── index.html ├── webpack.config.js ├── README.md └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | node_modules 3 | browser-bundle.js 4 | browser-bundle.js.map -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015", 4 | "react" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | var ReactDOM = require('react-dom'); 3 | 4 | ReactDOM.render(

Hello React!

, document.getElementById('root')); 5 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React Webpack template 4 | 5 | 6 |
If you see this then something is wrong.
7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: './index', 3 | output: { 4 | filename: 'browser-bundle.js' 5 | }, 6 | devtool: 'source-map', 7 | module: { 8 | loaders: [ 9 | { 10 | test: /\.js$/, 11 | loader: 'babel-loader', 12 | query: { 13 | presets: ['es2015', 'react'] 14 | } 15 | }, 16 | ] 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-webpack-template 2 | 3 | This is a simple template for building React apps. Use this to get started, and if you find yourself needing additional features, see my [webpack-howto](https://github.com/petehunt/webpack-howto). 4 | 5 | ## How to use this 6 | 7 | * Clone the repo: `git clone https://github.com/petehunt/react-webpack-template my-new-project` 8 | * Install the dependencies: `cd my-new-project && npm install` 9 | * Start webpack: `npm start` 10 | * Add your code to `index.js` and open `index.html` 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-webpack-template", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "webpack --progress --colors --watch", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "BSD-2-Clause", 12 | "dependencies": { 13 | "react": "^0.14.5", 14 | "react-dom": "^0.14.5" 15 | }, 16 | "devDependencies": { 17 | "babel-core": "^6.3.26", 18 | "babel-loader": "^6.2.0", 19 | "babel-preset-es2015": "^6.3.13", 20 | "babel-preset-react": "^6.3.13", 21 | "webpack": "^1.12.9" 22 | } 23 | } 24 | --------------------------------------------------------------------------------