Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -56,16 +57,32 @@ module.exports = {
},
},
optimization: {
minimize: false,
minimize: !__DEV__,
minimizer: [
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same options as in packages/react-devtools-extensions/webpack.config.js. I'll merge these two configs once they're similar enough.

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,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a mistake. react-devtools-extensions/webpack.config.js doesn't define that var either.

// By importing `shared/` we may import ReactFeatureFlags
__EXPERIMENTAL__: true,
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
Expand Down
Loading