Skip to content

Commit

Permalink
adds clean webpack plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
berkeleycole committed Jul 14, 2019
1 parent 7f867df commit 4b2fcf2
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
60 changes: 60 additions & 0 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 @@ -21,6 +21,7 @@
"@babel/core": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^3.0.0",
"html-webpack-plugin": "^3.2.0",
"webpack-dev-server": "^3.7.2"
}
Expand Down
10 changes: 10 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebPackPlugin = require("html-webpack-plugin")
const { CleanWebpackPlugin } = require('clean-webpack-plugin')

module.exports = {
entry: './src/client/index.js',
Expand All @@ -19,6 +20,15 @@ module.exports = {
new HtmlWebPackPlugin({
template: "./src/client/views/index.html",
filename: "./index.html",
}),
new CleanWebpackPlugin({
// Simulate the removal of files
dry: true,
// Write Logs to Console
verbose: true,
// Automatically remove all unused webpack assets on rebuild
cleanStaleWebpackAssets: true,
protectWebpackAssets: false
})
]
}

0 comments on commit 4b2fcf2

Please sign in to comment.