Skip to content

Commit

Permalink
Removes unused plugin & cleans images
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Feb 7, 2021
1 parent dc2cdc2 commit 9d1143c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9152,7 +9152,6 @@
"fork-ts-checker-webpack-plugin": "6.1.0",
"html-loader": "1.3.2",
"html-webpack-plugin": "5.0.0-beta.6",
"html-webpack-skip-assets-plugin": "0.0.2",
"image-minimizer-webpack-plugin": "2.2.0",
"imagemin-webp": "6.0.0",
"mini-css-extract-plugin": "1.3.5",
Expand Down
14 changes: 11 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const CspHtmlPlugin = require('csp-html-webpack-plugin');
const { ESBuildPlugin, ESBuildMinifyPlugin } = require('esbuild-loader');
const ForkTsCheckerPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlPlugin = require('html-webpack-plugin');
const HtmlSkipAssetsPlugin = require('html-webpack-skip-assets-plugin').HtmlWebpackSkipAssetsPlugin;
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
Expand Down Expand Up @@ -247,7 +246,17 @@ function getWebviewsConfig(mode, env) {
* @type WebpackConfig['plugins'] | any
*/
const plugins = [
new CleanPlugin(),
new CleanPlugin(
mode === 'production'
? {
cleanOnceBeforeBuildPatterns: [
path.posix.join(__dirname.replace(/\\/g, '/'), 'images', 'settings', '**'),
],
dangerouslyAllowCleanPatternsOutsideProject: true,
dry: false,
}
: undefined,
),
new ForkTsCheckerPlugin({
async: false,
eslint: {
Expand Down Expand Up @@ -347,7 +356,6 @@ function getWebviewsConfig(mode, env) {
}
: false,
}),
new HtmlSkipAssetsPlugin({}),
new CspHtmlPlugin(),
new InlineChunkHtmlPlugin(HtmlPlugin, mode === 'production' ? ['\\.css$'] : []),
new CopyPlugin({
Expand Down

0 comments on commit 9d1143c

Please sign in to comment.