@samitouri / QOS-React-2 / commits / a9ba5283d9

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

Brian Vaughn committed Jul 15, 2020 at 10:38 UTC a9ba5283d9ad1b1a1fa7ae1eaa217ea8cf0c1c4c
4 files changed +6 -27
packages/react-devtools-extensions/webpack.backend.js
+1 -9
@@ -2,7 +2,6 @@
2
3 const {resolve} = require('path');
4 const {DefinePlugin} = require('webpack');
5 -const TerserPlugin = require('terser-webpack-plugin');
5 const {GITHUB_URL, getVersionString} = require('./utils');
6
7 const NODE_ENV = process.env.NODE_ENV;
@@ -41,14 +40,7 @@ module.exports = {
40 },
41 },
42 optimization: {
44 - minimizer: [
45 - new TerserPlugin({
46 - terserOptions: {
47 - compress: {drop_debugger: false},
48 - output: {comments: true},
49 - },
50 - }),
51 - ],
43 + minimize: false,
44 },
45 plugins: [
46 new DefinePlugin({
packages/react-devtools-extensions/webpack.config.js
+3
@@ -44,6 +44,9 @@ module.exports = {
44 scheduler: resolve(builtModulesDir, 'scheduler'),
45 },
46 },
47 + optimization: {
48 + minimize: false,
49 + },
50 plugins: [
51 new DefinePlugin({
52 __DEV__: false,
packages/react-devtools-inline/webpack.config.js
+1 -9
@@ -1,6 +1,5 @@
1 const {resolve} = require('path');
2 const {DefinePlugin} = require('webpack');
3 -const TerserPlugin = require('terser-webpack-plugin');
3 const {
4 GITHUB_URL,
5 getVersionString,
@@ -38,14 +37,7 @@ module.exports = {
37 scheduler: 'scheduler',
38 },
39 optimization: {
41 - minimizer: [
42 - new TerserPlugin({
43 - terserOptions: {
44 - compress: {drop_debugger: false},
45 - output: {comments: true},
46 - },
47 - }),
48 - ],
40 + minimize: false,
41 },
42 plugins: [
43 new DefinePlugin({
packages/react-devtools-shell/webpack.config.js
+1 -9
@@ -1,6 +1,5 @@
1 const {resolve} = require('path');
2 const {DefinePlugin} = require('webpack');
3 -const TerserPlugin = require('terser-webpack-plugin');
3 const {
4 GITHUB_URL,
5 getVersionString,
@@ -41,14 +40,7 @@ const config = {
40 },
41 },
42 optimization: {
44 - minimizer: [
45 - new TerserPlugin({
46 - terserOptions: {
47 - compress: {drop_debugger: false},
48 - output: {comments: true},
49 - },
50 - }),
51 - ],
43 + minimize: false,
44 },
45 plugins: [
46 new DefinePlugin({