From daa7529f3d86a289b2b0aac27a481b4a2bc9ac2d Mon Sep 17 00:00:00 2001 From: Bruce Berrios <58147810+Bruception@users.noreply.github.com> Date: Wed, 22 Jun 2022 06:11:14 -0400 Subject: [PATCH] Webpack configs housekeeping (#3179) bruception --- frontend/webpack/config.base.js | 10 ---------- frontend/webpack/config.dev.js | 8 +++++++- frontend/webpack/config.prod.js | 8 ++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/frontend/webpack/config.base.js b/frontend/webpack/config.base.js index 9110d05eb..6d6ed9141 100644 --- a/frontend/webpack/config.base.js +++ b/frontend/webpack/config.base.js @@ -3,8 +3,6 @@ const CopyPlugin = require("copy-webpack-plugin"); const CircularDependencyPlugin = require("circular-dependency-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -const RemovePlugin = require("remove-files-webpack-plugin"); -const ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin"); let circularImports = 0; @@ -114,14 +112,6 @@ const BASE_CONFIG = { new MiniCssExtractPlugin({ filename: "./css/style.[chunkhash:8].css", }), - new RemovePlugin({ - after: { - include: [resolve(__dirname, "../public/html")], - }, - }), - new ExtraWatchWebpackPlugin({ - dirs: [resolve(__dirname, "../static/html")], - }), ], }; diff --git a/frontend/webpack/config.dev.js b/frontend/webpack/config.dev.js index 804be9bdd..e24ce819c 100644 --- a/frontend/webpack/config.dev.js +++ b/frontend/webpack/config.dev.js @@ -1,5 +1,7 @@ +const { resolve } = require("path"); const { merge } = require("webpack-merge"); const BASE_CONFIG = require("./config.base"); +const ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin"); /** @type { import('webpack').Configuration } */ const DEV_CONFIG = { @@ -10,12 +12,16 @@ const DEV_CONFIG = { port: 3000, open: true, hot: false, - liveReload: true, historyApiFallback: true, client: { overlay: false, }, }, + plugins: [ + new ExtraWatchWebpackPlugin({ + dirs: [resolve(__dirname, "../static/html")], + }), + ], }; module.exports = merge(BASE_CONFIG, DEV_CONFIG); diff --git a/frontend/webpack/config.prod.js b/frontend/webpack/config.prod.js index 8649e4469..0e8a9a554 100644 --- a/frontend/webpack/config.prod.js +++ b/frontend/webpack/config.prod.js @@ -1,5 +1,6 @@ const { resolve } = require("path"); const { merge } = require("webpack-merge"); +const RemovePlugin = require("remove-files-webpack-plugin"); const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); const HtmlMinimizerPlugin = require("html-minimizer-webpack-plugin"); const JsonMinimizerPlugin = require("json-minimizer-webpack-plugin"); @@ -64,6 +65,13 @@ const PRODUCTION_CONFIG = { new CssMinimizerPlugin(), ], }, + plugins: [ + new RemovePlugin({ + after: { + include: [resolve(__dirname, "../public/html")], + }, + }), + ], }; module.exports = merge(BASE_CONFIG, PRODUCTION_CONFIG);