Это должно принадлежать config/webpack/environment.js
или config/webpack/development.js
Попробуйте вставить его в config/webpack/environment.js
:
const { environment } = require('@rails/webpacker')
// ... other code
const webpack = require('webpack')
environment.plugins.append('DefinePlugin', new webpack.DefinePlugin({
'__REACT_DEVTOOLS_GLOBAL_HOOK__': '({ isDisabled: true })'
}))
// ... other code
module.exports = environment
Или в config/webpack/development.js
:
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
const webpack = require('webpack')
environment.plugins.append('DefinePlugin', new webpack.DefinePlugin({
'__REACT_DEVTOOLS_GLOBAL_HOOK__': '({ isDisabled: true })'
}))
module.exports = environment.toWebpackConfig()