webpack.config.js 526 B

12345678910111213141516171819202122232425262728
  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. output: {
  12. path: __dirname + "/dist",
  13. filename: "index_bundle.js"
  14. },
  15. module: {
  16. loaders: [
  17. {
  18. test: /\.js$/,
  19. exclude: /node_modules/,
  20. loader: "babel-loader"
  21. }
  22. ]
  23. },
  24. plugins: [
  25. HtmlWebpackPluginConfig
  26. ]
  27. };