From d6a5ea563606a3e942871f2a27e1f49bffc0c69a Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 19 Feb 2023 22:04:26 +0100 Subject: [PATCH] Ensure clean-webpack-plugin does not delete HTML export files Signed-off-by: David Mehren --- webpack.common.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 5cf99d1bc..b19fd9891 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,7 +3,7 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') -const {CleanWebpackPlugin} = require("clean-webpack-plugin"); +const { CleanWebpackPlugin } = require('clean-webpack-plugin') // Fix possible nofile-issues const fs = require('fs') @@ -13,7 +13,13 @@ gracefulFs.gracefulify(fs) module.exports = { name: 'app', plugins: [ - new CleanWebpackPlugin(), + new CleanWebpackPlugin({ + cleanOnceBeforeBuildPatterns: [ + '**/*', + '!htmlExport*', + '!htmlexport*' + ] + }), new webpack.ProvidePlugin({ Visibility: 'visibilityjs', Cookies: 'js-cookie',