1npx create-react-app <appname> // eg: npx create-react-app blog
2cd <appname> // cd blog
3npm start //runs on localhost:3000
1const path = require('path');
2const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4module.exports = {
5 entry: './main.js',
6 output: {
7 path: path.join(__dirname, '/bundle'),
8 filename: 'index_bundle.js'
9 },
10 devServer: {
11 inline: true,
12 port: 8001
13 },
14 module: {
15 rules: [
16 {
17 test: /\.jsx?$/,
18 exclude: /node_modules/,
19 loader: 'babel-loader',
20 query: {
21 presets: ['es2015', 'react']
22 }
23 }
24 ]
25 },
26 plugins:[
27 new HtmlWebpackPlugin({
28 template: './index.html'
29 })
30 ]
31}