Created
April 29, 2016 16:40
-
-
Save sword-jin/051d7c855b9ed67b5516f20038fd53a8 to your computer and use it in GitHub Desktop.
React webpack.config.js
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
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"react" | |
] | |
} |
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
"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": "*" | |
} |
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
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