Skip to content
Permalink
Browse files

configure clean-webpack-plugin

The plugin will delete the contents of the dist directory before each
build
  • Loading branch information...
nicoqh committed Jun 3, 2019
1 parent d5e9698 commit d955da77650b63c29939a668de0dad50e235f37f
Showing with 6 additions and 0 deletions.
  1. +6 −0 webpack.config.js
@@ -1,5 +1,6 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

// We'll refer to our source and dist paths frequently, so let's store them here
const PATH_SOURCE = path.join(__dirname, './src');
@@ -82,6 +83,11 @@ module.exports = env => {
new HtmlWebpackPlugin({
template: path.join(PATH_SOURCE, './index.html'),
}),

// This plugin will delete all files inside `output.path` (the dist directory),
// but the directory itself will be kept.
// https://github.com/johnagan/clean-webpack-plugin
new CleanWebpackPlugin(),
],
};
};

0 comments on commit d955da7

Please sign in to comment.
You can’t perform that action at this time.