Skip to content

Instantly share code, notes, and snippets.

@sword-jin
Created April 29, 2016 16:40
Show Gist options
  • Save sword-jin/051d7c855b9ed67b5516f20038fd53a8 to your computer and use it in GitHub Desktop.
Save sword-jin/051d7c855b9ed67b5516f20038fd53a8 to your computer and use it in GitHub Desktop.
React webpack.config.js
{
"presets": [
"es2015",
"react"
]
}
"dependencies": {
"react": "15.0.1",
"react-dom": "15.0.1",
"react-router": "2.4.0"
},
"devDependencies": {
"babel-core": "6.7.7",
"babel-loader": "6.2.4",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"webpack": "1.13.0",
"webpack-dev-server": "1.14.1",
"html-webpack-plugin": "*"
}
var HtmlWebpackPlugin = require('html-webpack-plugin')
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
module.exports = {
entry: [
'./app/index.js'
],
module: {
loaders: [
{test: /\.js/, exclude: /node_modules/, loader: "babel"}
]
},
output: {
filename: "index_bundle.js",
path: __dirname + '/dist'
},
plugins: [HTMLWebpackPluginConfig]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment