Merge pull request #4185 from overleaf/ae-react-devtool-toggle

Fix React DevTools enable/disable toggle

GitOrigin-RevId: 505e948af96b9ecc658b5e809dce98a5e72dca0f
This commit is contained in:
Alf Eaton 2021-06-11 11:17:28 +01:00 committed by Copybot
parent 05e427624b
commit 669bec323c

View file

@ -18,13 +18,11 @@ module.exports = merge(base, {
}),
// Disable React DevTools if DISABLE_REACT_DEVTOOLS is set to "true"
new webpack.DefinePlugin({
__REACT_DEVTOOLS_GLOBAL_HOOK__:
process.env.DISABLE_REACT_DEVTOOLS === 'true'
? '({ isDisabled: true })'
: undefined,
}),
],
process.env.DISABLE_REACT_DEVTOOLS === 'true' &&
new webpack.DefinePlugin({
__REACT_DEVTOOLS_GLOBAL_HOOK__: '({ isDisabled: true })',
}),
].filter(Boolean),
devServer: {
// Expose dev server at www.dev-overleaf.com