added clean-webpack-plugin to webpack build base

This commit is contained in:
2021-08-04 18:25:42 +02:00
parent 6a7e39fed8
commit 8c0d992feb
3 changed files with 138 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ const { VueLoaderPlugin } = require('vue-loader')
const ESLintPlugin = require('eslint-webpack-plugin');
const ExtraneousFileCleanupPlugin = require('webpack-extraneous-file-cleanup-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const utils = require('./utils')
@@ -159,5 +160,17 @@ module.exports = {
minBytes: 4096
}),
new CompressionPlugin(),
/**
* All files inside webpack's output.path directory will be removed once, but the
* directory itself will not be. If using webpack 4+'s default configuration,
* everything under <PROJECT_DIR>/dist/ will be removed.
* Use cleanOnceBeforeBuildPatterns to override this behavior.
*
* During rebuilds, all webpack assets that are not used anymore
* will be removed automatically.
*
* See `Options and Defaults` for information
*/
new CleanWebpackPlugin(),
]
}