From 523311101acac856126fc7b21d60c5bd11313bd7 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 23 Mar 2022 11:54:39 +0100 Subject: [PATCH] (bug) Error: Cannot find module '@pmmmwh/react-refresh-webpack-plugin' in production env --- config/webpack/webpack.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js index 8fa27ffaf..5bd65571c 100644 --- a/config/webpack/webpack.config.js +++ b/config/webpack/webpack.config.js @@ -2,8 +2,6 @@ const { webpackConfig, merge } = require('shakapacker'); const webpack = require('webpack'); const path = require('path'); -const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); - const htmlErb = require('./modules/html_erb'); const jsErb = require('./modules/js_erb'); const sass = require('./modules/sass'); @@ -33,7 +31,7 @@ const customConfig = { Application: [path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/app.js')), 'Application'], process: 'process/browser' }), - isDevelopment && new ReactRefreshWebpackPlugin() + isDevelopment && new (require('@pmmmwh/react-refresh-webpack-plugin'))() ].filter(Boolean), module: { rules: [