Skip to content

Commit

Permalink
Disable DevTools minification (#19369)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Brian Vaughn authored Jul 15, 2020
1 parent 45eef8b commit a9ba528
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
10 changes: 1 addition & 9 deletions packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

const NODE_ENV = process.env.NODE_ENV;
Expand Down Expand Up @@ -41,14 +40,7 @@ module.exports = {
},
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {drop_debugger: false},
output: {comments: true},
},
}),
],
minimize: false,
},
plugins: [
new DefinePlugin({
Expand Down
3 changes: 3 additions & 0 deletions packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module.exports = {
scheduler: resolve(builtModulesDir, 'scheduler'),
},
},
optimization: {
minimize: false,
},
plugins: [
new DefinePlugin({
__DEV__: false,
Expand Down
10 changes: 1 addition & 9 deletions packages/react-devtools-inline/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const {
GITHUB_URL,
getVersionString,
Expand Down Expand Up @@ -38,14 +37,7 @@ module.exports = {
scheduler: 'scheduler',
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {drop_debugger: false},
output: {comments: true},
},
}),
],
minimize: false,
},
plugins: [
new DefinePlugin({
Expand Down
10 changes: 1 addition & 9 deletions packages/react-devtools-shell/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const {
GITHUB_URL,
getVersionString,
Expand Down Expand Up @@ -41,14 +40,7 @@ const config = {
},
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {drop_debugger: false},
output: {comments: true},
},
}),
],
minimize: false,
},
plugins: [
new DefinePlugin({
Expand Down

0 comments on commit a9ba528

Please sign in to comment.