mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[DevTools] Minify backend (#34507)
This commit is contained in:
committed by
GitHub
parent
7899729130
commit
16df13b84c
@@ -2,6 +2,7 @@
|
||||
|
||||
const {resolve, isAbsolute, relative} = require('path');
|
||||
const Webpack = require('webpack');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
||||
const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils');
|
||||
const SourceMapIgnoreListPlugin = require('react-devtools-shared/SourceMapIgnoreListPlugin');
|
||||
@@ -56,16 +57,32 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
optimization: {
|
||||
minimize: false,
|
||||
minimize: !__DEV__,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
compress: {
|
||||
unused: true,
|
||||
dead_code: true,
|
||||
},
|
||||
mangle: {
|
||||
keep_fnames: true,
|
||||
},
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
extractComments: false,
|
||||
}),
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new Webpack.ProvidePlugin({
|
||||
process: 'process/browser',
|
||||
}),
|
||||
new Webpack.DefinePlugin({
|
||||
__DEV__: true,
|
||||
__DEV__,
|
||||
__PROFILE__: false,
|
||||
__DEV____DEV__: true,
|
||||
// By importing `shared/` we may import ReactFeatureFlags
|
||||
__EXPERIMENTAL__: true,
|
||||
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
|
||||
|
||||
Reference in New Issue
Block a user