Skip to content

Commit a9ba528

Browse files
author
Brian Vaughn
authored
Disable DevTools minification (#19369)
DevTools isn't being downloaded like typical JavaScript, so bundle size concerns don't apply. Parsing is still a consideration (so I'm open for discussion here) but I think this change would provide a couple of benefits: * People are more likely to *actually read* non-minified source code when e.g. a breakpoint is hit (as with the recent debugger statement) * Component stacks will be easier to parse on bug reports
1 parent 45eef8b commit a9ba528

File tree

4 files changed

+6
-27
lines changed

4 files changed

+6
-27
lines changed

packages/react-devtools-extensions/webpack.backend.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const {resolve} = require('path');
44
const {DefinePlugin} = require('webpack');
5-
const TerserPlugin = require('terser-webpack-plugin');
65
const {GITHUB_URL, getVersionString} = require('./utils');
76

87
const NODE_ENV = process.env.NODE_ENV;
@@ -41,14 +40,7 @@ module.exports = {
4140
},
4241
},
4342
optimization: {
44-
minimizer: [
45-
new TerserPlugin({
46-
terserOptions: {
47-
compress: {drop_debugger: false},
48-
output: {comments: true},
49-
},
50-
}),
51-
],
43+
minimize: false,
5244
},
5345
plugins: [
5446
new DefinePlugin({

packages/react-devtools-extensions/webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ module.exports = {
4444
scheduler: resolve(builtModulesDir, 'scheduler'),
4545
},
4646
},
47+
optimization: {
48+
minimize: false,
49+
},
4750
plugins: [
4851
new DefinePlugin({
4952
__DEV__: false,

packages/react-devtools-inline/webpack.config.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const {resolve} = require('path');
22
const {DefinePlugin} = require('webpack');
3-
const TerserPlugin = require('terser-webpack-plugin');
43
const {
54
GITHUB_URL,
65
getVersionString,
@@ -38,14 +37,7 @@ module.exports = {
3837
scheduler: 'scheduler',
3938
},
4039
optimization: {
41-
minimizer: [
42-
new TerserPlugin({
43-
terserOptions: {
44-
compress: {drop_debugger: false},
45-
output: {comments: true},
46-
},
47-
}),
48-
],
40+
minimize: false,
4941
},
5042
plugins: [
5143
new DefinePlugin({

packages/react-devtools-shell/webpack.config.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const {resolve} = require('path');
22
const {DefinePlugin} = require('webpack');
3-
const TerserPlugin = require('terser-webpack-plugin');
43
const {
54
GITHUB_URL,
65
getVersionString,
@@ -41,14 +40,7 @@ const config = {
4140
},
4241
},
4342
optimization: {
44-
minimizer: [
45-
new TerserPlugin({
46-
terserOptions: {
47-
compress: {drop_debugger: false},
48-
output: {comments: true},
49-
},
50-
}),
51-
],
43+
minimize: false,
5244
},
5345
plugins: [
5446
new DefinePlugin({

0 commit comments

Comments
 (0)