diff options
| author | mokha <mokha@cisco.com> | 2018-09-29 09:52:31 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-09-29 09:52:31 -0600 |
| commit | a6235c463c6b6ac42bcf4ae6568be0687a59538d (patch) | |
| tree | 725a793abdfffacd1bbe5d0f10b2aec74fad2bde /webpack.parts.js | |
| parent | fb63e5f976598dd23c0007497c201bd3f194c2ba (diff) | |
clean the target dir before building
Diffstat (limited to 'webpack.parts.js')
| -rw-r--r-- | webpack.parts.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webpack.parts.js b/webpack.parts.js index 347421d..8e19318 100644 --- a/webpack.parts.js +++ b/webpack.parts.js @@ -1,5 +1,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const PurifyCSSPlugin = require('purifycss-webpack'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); exports.extractCSS = ({ include, exclude, use = [] }) => { const plugin = new MiniCssExtractPlugin({ @@ -93,3 +94,7 @@ exports.loadJavaScript = ({ include, exclude } = {}) => ( exports.generateSourceMaps = ({ type }) => ({ devtool: type, }); + +exports.clean = path => ({ + plugins: [new CleanWebpackPlugin([path])], +}); |
