├── .gitignore ├── README.md ├── app ├── components │ └── App.jsx └── index.jsx ├── build └── index.html ├── package.json └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My React Boilerplate 2 | 3 | includes webpack, webpack-dev-server, jsx, and es6 4 | 5 | To be continued! 6 | -------------------------------------------------------------------------------- /app/components/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | export default class App extends Component { 4 | render(){ 5 | return ( 6 |
7 |

Hello!

8 |
9 | ) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/index.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import ReactDOM from 'react-dom' 3 | 4 | import App from './components/App' 5 | 6 | ReactDOM.render(, document.getElementById('app')); 7 | -------------------------------------------------------------------------------- /build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webpack-stuff", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "babel-loader": "^6.2.4", 8 | "babel-preset-es2015": "^6.6.0", 9 | "babel-preset-react": "^6.5.0", 10 | "react": "^15.0.1", 11 | "react-dom": "^15.0.1", 12 | "react-redux": "^4.4.5", 13 | "redux": "^3.5.2", 14 | "webpack": "^1.13.0" 15 | }, 16 | "devDependencies": { 17 | "chai": "^3.5.0", 18 | "enzyme": "^2.4.1", 19 | "mocha": "^3.0.0", 20 | "webpack-dev-server": "^1.14.1" 21 | }, 22 | "scripts": { 23 | "test": "echo \"Error: no test specified\" && exit 1", 24 | "dev": "webpack-dev-server -d", 25 | "build": "webpack" 26 | }, 27 | "keywords": [], 28 | "author": "", 29 | "license": "ISC" 30 | } 31 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack') 2 | var path = require('path') 3 | 4 | var BUILD_DIR = path.resolve(__dirname + '/build') 5 | var APP_DIR = path.resolve(__dirname + '/app') 6 | 7 | var config = { 8 | entry: APP_DIR + '/index.jsx' 9 | , output: { 10 | path: BUILD_DIR 11 | , filename: 'bundle.js' 12 | , publicPath: '/' 13 | } 14 | , resolve: { 15 | extensions: ['', '.js', '.jsx'] 16 | } 17 | , devtool: 'source-map' 18 | , devServer: { 19 | inline: true 20 | , contentBase: BUILD_DIR 21 | , port: 3333 22 | } 23 | , module: { 24 | loaders: [ 25 | { 26 | test: /\.jsx?/ 27 | , include: APP_DIR 28 | , loader: 'babel' 29 | , query: { 30 | presets: ['es2015', 'react'] 31 | } 32 | } 33 | ] 34 | } 35 | } 36 | 37 | module.exports = config 38 | --------------------------------------------------------------------------------