Skip to content

Commit

Permalink
webpack tweaks:
Browse files Browse the repository at this point in the history
* add chunkhash to output filename
* clean dist before build
  • Loading branch information
ldgit committed Sep 9, 2018
1 parent d673162 commit 4392878
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
37 changes: 16 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@babel/register": "^7.0.0",
"babel-loader": "^8.0.2",
"chai": "^4.1.2",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^1.0.0",
"eslint": "^5.5.0",
"eslint-config-airbnb": "^17.1.0",
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');

module.exports = {
entry: {
main: './src/index.jsx',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
filename: '[name].[chunkhash].js',
},
devtool: 'inline-source-map',
devServer: {
Expand Down Expand Up @@ -35,6 +36,7 @@ module.exports = {
],
},
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
title: 'Tic-Tac-Toe',
}),
Expand Down

0 comments on commit 4392878

Please sign in to comment.