Skip to content

Commit

Permalink
Replace __DEV__ with false in production builds.
Browse files Browse the repository at this point in the history
Anticipating apollographql/apollo-client#8347
landing in Apollo Client v3.4.
  • Loading branch information
benjamn committed Jun 4, 2021
1 parent 0ec9503 commit bffee24
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
14 changes: 14 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const {
override,
addWebpackPlugin,
} = require("customize-cra");

const webpack = require("webpack");

module.exports = override(
addWebpackPlugin(
new webpack.DefinePlugin({
__DEV__: JSON.stringify(false),
}),
),
);
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"react-dom": "^16.14.0"
},
"devDependencies": {
"customize-cra": "^1.0.0",
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "react-app-rewired build",
"test": "react-scripts test --env=jsdom"
},
"browserslist": [
Expand Down

0 comments on commit bffee24

Please sign in to comment.