mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-20 12:13:42 +00:00
Merge pull request #24024 from overleaf/ae-react-refresh-enabled
Use process.env.REACT_REFRESH_ENABLED for configuration GitOrigin-RevId: e97967e52bed10422b0e2cce53fb09e2745a5c4a
This commit is contained in:
parent
3a67124f90
commit
6f826c5546
2 changed files with 10 additions and 10 deletions
|
@ -3,8 +3,6 @@ const { merge } = require('webpack-merge')
|
|||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
|
||||
|
||||
process.env.REACT_REFRESH = '1'
|
||||
|
||||
const base = require('./webpack.config')
|
||||
|
||||
// if WEBPACK_ENTRYPOINTS is defined, remove any entrypoints that aren't included
|
||||
|
@ -57,13 +55,14 @@ module.exports = merge(base, {
|
|||
filename: 'stylesheets/[name].css',
|
||||
}),
|
||||
|
||||
new ReactRefreshWebpackPlugin({
|
||||
exclude: [
|
||||
/node_modules/, // default
|
||||
/source-editor/, // avoid crashing the source editor
|
||||
],
|
||||
overlay: false,
|
||||
}),
|
||||
process.env.REACT_REFRESH_ENABLED === 'true' &&
|
||||
new ReactRefreshWebpackPlugin({
|
||||
exclude: [
|
||||
/node_modules/, // default
|
||||
/source-editor/, // avoid crashing the source editor
|
||||
],
|
||||
overlay: false,
|
||||
}),
|
||||
|
||||
// Disable React DevTools if DISABLE_REACT_DEVTOOLS is set to "true"
|
||||
process.env.DISABLE_REACT_DEVTOOLS === 'true' &&
|
||||
|
|
|
@ -143,7 +143,8 @@ module.exports = {
|
|||
cacheDirectory: true,
|
||||
configFile: path.join(__dirname, './babel.config.json'),
|
||||
plugins: [
|
||||
process.env.REACT_REFRESH && 'react-refresh/babel',
|
||||
process.env.REACT_REFRESH_ENABLED === 'true' &&
|
||||
'react-refresh/babel',
|
||||
].filter(Boolean),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue