Created
September 28, 2016 02:52
-
-
Save jpgcode/6144bd3830d787aa3da5e8ea20354256 to your computer and use it in GitHub Desktop.
Simple webpack for JSX react with hot realoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "reactplayground", | |
"version": "1.0.0", | |
"description": "", | |
"main": "webpack.config.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "webpack-dev-server --progress --colors --hot --inline --open" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "git+https://github.com/jpgcode/react-playground.git" | |
}, | |
"author": "", | |
"license": "ISC", | |
"bugs": { | |
"url": "https://github.com/jpgcode/react-playground/issues" | |
}, | |
"homepage": "https://github.com/jpgcode/react-playground#readme", | |
"dependencies": { | |
"react": "^15.3.2", | |
"react-dom": "^15.3.2" | |
}, | |
"devDependencies": { | |
"babel-core": "^6.14.0", | |
"babel-loader": "^6.2.5", | |
"babel-preset-es2015": "^6.14.0", | |
"babel-preset-react": "^6.11.1", | |
"webpack": "^1.13.2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
entry: './main.js', | |
output: { path: __dirname, filename: 'bundle.js' }, | |
module: { | |
loaders: [ | |
{ | |
test: /.jsx?$/, | |
loader: 'babel-loader', | |
exclude: /node_modules/, | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
} | |
] | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment