Skip to content

Commit ef6bf0e

Browse files
purfectliteratureadi-herwana-nus
authored andcommitted
perf: partially remove PropTypes in production
1 parent d4432c2 commit ef6bf0e

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

client/.babelrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@
3636
"env": {
3737
"production": {
3838
"plugins": [
39-
["react-remove-properties", { "properties": ["data-testid"] }]
39+
["react-remove-properties", { "properties": ["data-testid"] }],
40+
[
41+
"transform-react-remove-prop-types",
42+
{
43+
"mode": "remove",
44+
"removeImport": true
45+
}
46+
]
4047
]
4148
},
4249
"test": {

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
"babel-plugin-istanbul": "^6.1.1",
149149
"babel-plugin-react-remove-properties": "^0.3.0",
150150
"babel-plugin-transform-import-meta": "^2.2.1",
151+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
151152
"css-loader": "^6.11.0",
152153
"cssnano": "^6.1.2",
153154
"dotenv-webpack": "^8.0.1",

client/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,11 @@ babel-plugin-transform-import-meta@^2.2.1:
35113511
"@babel/template" "^7.4.4"
35123512
tslib "^2.4.0"
35133513

3514+
babel-plugin-transform-react-remove-prop-types@^0.4.24:
3515+
version "0.4.24"
3516+
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a"
3517+
integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==
3518+
35143519
babel-preset-current-node-syntax@^1.0.0:
35153520
version "1.0.1"
35163521
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b"

0 commit comments

Comments
 (0)