webpack.config.js 619 B

1234567891011121314151617181920212223242526272829303132333435
  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. loader: "babel-loader",
  15. test: /\.js$/,
  16. exclude: /node_modules/,
  17. query: {
  18. plugins: [],
  19. presets: ["es2015", "react"]
  20. }
  21. }
  22. ]
  23. },
  24. output: {
  25. filename: "index_bundle.js",
  26. path: __dirname + "/dist"
  27. },
  28. plugins: [
  29. HtmlWebpackPluginConfig
  30. ]
  31. };