webpack.config.js 739 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. include: __dirname + '/app',
  17. exclude: /node_modules/,
  18. query: {
  19. plugins: [],
  20. presets: ['es2015', 'react']
  21. }
  22. },
  23. {
  24. loader: 'style-loader!css-loader',
  25. test: /\.css$/
  26. }
  27. ]
  28. },
  29. output: {
  30. filename: 'index_bundle.js',
  31. path: __dirname + '/dist'
  32. },
  33. plugins: [
  34. HtmlWebpackPluginConfig
  35. ]
  36. };