Last active
July 20, 2018 19:57
-
-
Save nairihar/5d136ae0cda7cdca419df8c09c463678 to your computer and use it in GitHub Desktop.
Setup React App - Organizing React Application Part 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: { | |
app: './src/index.js' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader" | |
} | |
} | |
] | |
}, | |
plugins: [ | |
new CleanWebpackPlugin(['dist']), | |
new HtmlWebpackPlugin({ | |
template: './src/index.html' | |
}), | |
], | |
output: { | |
filename: '[name].bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment