Advertisement
yoesoff

react getting started

Sep 2nd, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var path = require('path');
  2.   var webpack = require('webpack');
  3.  
  4.   // HTML
  5.   const HtmlWebpackPlugin = require('html-webpack-plugin');
  6.   const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
  7.     template: './src/index.html',
  8.     filename: 'index.html',
  9.     inject: 'body'
  10.   })
  11.  
  12.   module.exports = {
  13.     devtool: 'source-map',
  14.     entry: [
  15.       './src/index.js'
  16.     ],  
  17.     output: {
  18.       path: path.join(__dirname, 'dist'),
  19.       filename: 'bundle.js',
  20.     },  
  21.     module: {
  22.       loaders: [{
  23.           test: /.jsx?$/,
  24.           loader: 'babel-loader',
  25.           include: [
  26.               path.join(__dirname, 'src')
  27.           ],
  28.           exclude: /node_modules/,
  29.           query: {
  30.             presets: ['es2015', 'react']
  31.           }
  32.       }]  
  33.     },  
  34.     plugins: [HtmlWebpackPluginConfig]
  35.   };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement