Skip to content

Instantly share code, notes, and snippets.

@nairihar
Last active July 20, 2018 19:57
Show Gist options
  • Save nairihar/5d136ae0cda7cdca419df8c09c463678 to your computer and use it in GitHub Desktop.
Save nairihar/5d136ae0cda7cdca419df8c09c463678 to your computer and use it in GitHub Desktop.
Setup React App - Organizing React Application Part 1
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