Skip to content

Instantly share code, notes, and snippets.

@jpgcode
Created September 28, 2016 02:52
Show Gist options
  • Save jpgcode/6144bd3830d787aa3da5e8ea20354256 to your computer and use it in GitHub Desktop.
Save jpgcode/6144bd3830d787aa3da5e8ea20354256 to your computer and use it in GitHub Desktop.
Simple webpack for JSX react with hot realoding
{
"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"
}
}
'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