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);