webpack.config.js 562 B

12345678910111213141516171819202122232425262728293031
  1. var HtmlWebpackPlugin = require("html-webpack-plugin");
  2. var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
  3. template: __dirname + "/app/index.html",
  4. filename: "index.html",
  5. inject: "body"
  6. });
  7. module.exports = {
  8. entry: [
  9. "./app/index.js"
  10. ],
  11. module: {
  12. loaders: [
  13. {
  14. test: /\.js$/,
  15. exclude: /node_modules/,
  16. loader: "babel-loader?presets[]=es2015&presets[]=react"
  17. }
  18. ]
  19. },
  20. output: {
  21. filename: "index_bundle.js",
  22. path: __dirname + "/dist"
  23. },
  24. plugins: [
  25. HtmlWebpackPluginConfig
  26. ]
  27. };