Disable HMR error page by default
see diff
This commit is contained in:
parent
f8eb1d17f9
commit
219ea134ca
2 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
# To enable CSS hot-reload, set the following variable to 1.
|
# To enable CSS hot-reload, set the following variable to 1.
|
||||||
CSS_HOT_RELOAD=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.
|
# To use a single theme, uncomment the line with the theme you want to hot-reload.
|
||||||
MATRIX_THEMES='light'
|
MATRIX_THEMES='light'
|
||||||
#MATRIX_THEMES='dark'
|
#MATRIX_THEMES='dark'
|
||||||
|
|
|
@ -48,6 +48,7 @@ module.exports = (env, argv) => {
|
||||||
}
|
}
|
||||||
const devMode = nodeEnv !== 'production';
|
const devMode = nodeEnv !== 'production';
|
||||||
const useHMR = process.env.CSS_HOT_RELOAD === '1' && devMode;
|
const useHMR = process.env.CSS_HOT_RELOAD === '1' && devMode;
|
||||||
|
const fullPageErrors = process.env.FULL_PAGE_ERRORS === '1' && devMode;
|
||||||
|
|
||||||
const development = {};
|
const development = {};
|
||||||
if (argv.mode === "production") {
|
if (argv.mode === "production") {
|
||||||
|
@ -525,7 +526,7 @@ module.exports = (env, argv) => {
|
||||||
new HtmlWebpackInjectPreload({
|
new HtmlWebpackInjectPreload({
|
||||||
files: [{ match: /.*Inter.*\.woff2$/ }],
|
files: [{ match: /.*Inter.*\.woff2$/ }],
|
||||||
}),
|
}),
|
||||||
useHMR && new ReactRefreshWebpackPlugin(),
|
useHMR && new ReactRefreshWebpackPlugin(fullPageErrors ? undefined : { overlay: { entry: false } }),
|
||||||
|
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue