From 219ea134ca731edd7dfe32ab3480391ff1feaa4a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 25 Aug 2021 09:57:46 -0600 Subject: [PATCH] Disable HMR error page by default see diff --- .env.example | 2 ++ webpack.config.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index b0b909aa8..80fe62906 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ # To enable CSS hot-reload, set the following variable to 1. CSS_HOT_RELOAD=1 +# To use the annoying and inconsistent full page error dialog, set this to 1. +FULL_PAGE_ERRORS=0 # To use a single theme, uncomment the line with the theme you want to hot-reload. MATRIX_THEMES='light' #MATRIX_THEMES='dark' diff --git a/webpack.config.js b/webpack.config.js index 0f6d11070..484fe7003 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -48,6 +48,7 @@ module.exports = (env, argv) => { } const devMode = nodeEnv !== 'production'; const useHMR = process.env.CSS_HOT_RELOAD === '1' && devMode; + const fullPageErrors = process.env.FULL_PAGE_ERRORS === '1' && devMode; const development = {}; if (argv.mode === "production") { @@ -525,7 +526,7 @@ module.exports = (env, argv) => { new HtmlWebpackInjectPreload({ files: [{ match: /.*Inter.*\.woff2$/ }], }), - useHMR && new ReactRefreshWebpackPlugin(), + useHMR && new ReactRefreshWebpackPlugin(fullPageErrors ? undefined : { overlay: { entry: false } }), ].filter(Boolean),