Skip to content

Commit

Permalink
Strip console.log and propTypes from production build
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Nov 8, 2016
1 parent e8bd1de commit ffaf2e7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 99 deletions.
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
<<<<<<< e8bd1de0aa71219e7fe9d71a352c971457eec616
"presets": ["react-native"]
=======
"env": {
"production": {
"plugins": [
"transform-remove-console",
"transform-react-remove-prop-types"
]
}
}
>>>>>>> Strip console.log and propTypes from production build
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"devDependencies": {
"babel-jest": "^16.0.0",
"babel-preset-react-native": "^1.9.0",
"babel-plugin-transform-react-remove-prop-types": "^0.2.10",
"babel-plugin-transform-remove-console": "^6.8.0",
"eslint": "^2.5.3",
"eslint-plugin-react": "^6.5.0",
"jest": "^16.0.2",
Expand Down
126 changes: 27 additions & 99 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async@^2.0.1:
dependencies:
lodash "^4.14.0"

async@~0.2.6, async@~0.2.9, [email protected]:
async@~0.2.6:
version "0.2.10"
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"

Expand Down Expand Up @@ -606,6 +606,10 @@ babel-plugin-transform-react-jsx@^6.5.0, babel-plugin-transform-react-jsx@^6.8.0
babel-plugin-syntax-jsx "^6.8.0"
babel-runtime "^6.0.0"

babel-plugin-transform-react-remove-prop-types@^0.2.10:
version "0.2.10"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.2.10.tgz#eefd083057cccb0f9a85cb15f3a64227daf64609"

babel-plugin-transform-regenerator@^6.5.0:
version "6.16.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.16.1.tgz#a75de6b048a14154aae14b0122756c5bed392f59"
Expand All @@ -614,6 +618,12 @@ babel-plugin-transform-regenerator@^6.5.0:
babel-types "^6.16.0"
private "~0.1.5"

babel-plugin-transform-remove-console@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.8.0.tgz#c4162f01ee169491776e64093f4dad8d61125a90"
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-strict-mode@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d"
Expand Down Expand Up @@ -1133,10 +1143,6 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"

[email protected]:
version "0.6.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
Expand Down Expand Up @@ -1403,10 +1409,6 @@ currently-unhandled@^0.4.1:
dependencies:
array-find-index "^1.0.1"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"

d@^0.1.1, d@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309"
Expand All @@ -1432,7 +1434,13 @@ dateformat@^1.0.11:
get-stdin "^4.0.1"
meow "^3.3.0"

debug@^2.0.0, debug@^2.1.0, debug@^2.1.1, debug@^2.2.0, debug@~2.2.0, debug@2:
debug@^2.0.0, debug@^2.1.0, debug@^2.1.1, debug@^2.2.0, debug@2:
version "2.3.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.0.tgz#3912dc55d7167fc3af17d2b85c13f93deaedaa43"
dependencies:
ms "0.7.2"

debug@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
dependencies:
Expand Down Expand Up @@ -1502,10 +1510,6 @@ decompress@^3.0.0:
vinyl-assign "^1.0.1"
vinyl-fs "^2.2.0"

deep-equal@*:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"

deep-extend@^0.4.0, deep-extend@~0.4.0:
version "0.4.1"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253"
Expand Down Expand Up @@ -1992,10 +1996,6 @@ [email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"

[email protected]:
version "0.1.8"
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"

fancy-log@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.2.0.tgz#d5a51b53e9ab22ca07d558f2b67ae55fdb5fcbd8"
Expand Down Expand Up @@ -2145,8 +2145,8 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"

form-data@~2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.1.tgz#4adf0342e1a79afa1e84c8c320a9ffc82392a1f3"
version "2.1.2"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4"
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.5"
Expand Down Expand Up @@ -2548,10 +2548,6 @@ http-signature@~1.1.0:
jsprim "^1.2.2"
sshpk "^1.7.0"

[email protected]:
version "0.3.5"
resolved "https://registry.yarnpkg.com/i/-/i-0.3.5.tgz#1d2b854158ec8169113c6cb7f6b6801e99e211d5"

iconv-lite@^0.4.13, iconv-lite@^0.4.5, iconv-lite@~0.4.13, [email protected]:
version "0.4.13"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2"
Expand Down Expand Up @@ -2865,7 +2861,7 @@ isomorphic-fetch@^2.1.1:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"

isstream@~0.1.2, [email protected]:
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"

Expand Down Expand Up @@ -3722,7 +3718,7 @@ [email protected]:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"

mkdirp@^0.5.0, mkdirp@^0.5.1, [email protected], [email protected]:
mkdirp@^0.5.0, mkdirp@^0.5.1, [email protected]:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
Expand Down Expand Up @@ -3765,6 +3761,10 @@ [email protected]:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"

[email protected]:
version "0.7.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765"

multimatch@^2.0.0, multimatch@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b"
Expand All @@ -3787,10 +3787,6 @@ multipipe@^0.1.2:
dependencies:
duplexer2 "0.0.2"

mute-stream@~0.0.4:
version "0.0.6"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db"

[email protected]:
version "0.0.5"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
Expand All @@ -3799,10 +3795,6 @@ natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"

[email protected]:
version "0.4.2"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574"

[email protected]:
version "0.5.3"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.5.3.tgz#269d5c476810ec92edbe7b6c2f28316384f9a7e8"
Expand Down Expand Up @@ -4084,14 +4076,6 @@ pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"

[email protected]:
version "0.3.1"
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21"

[email protected]:
version "0.4.0"
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.0.tgz#349dbb7ffd38081fcadc0853df687f0c7744cd65"

plist@^1.2.0, [email protected]:
version "1.2.0"
resolved "https://registry.yarnpkg.com/plist/-/plist-1.2.0.tgz#084b5093ddc92506e259f874b8d9b1afb8c79593"
Expand Down Expand Up @@ -4151,16 +4135,6 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prompt@^0.2.14:
version "0.2.14"
resolved "https://registry.yarnpkg.com/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc"
dependencies:
pkginfo "0.x.x"
read "1.0.x"
revalidator "0.1.x"
utile "0.2.x"
winston "0.8.x"

prr@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
Expand Down Expand Up @@ -4237,15 +4211,6 @@ react-deep-force-update@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.0.1.tgz#f911b5be1d2a6fe387507dd6e9a767aa2924b4c7"

react-native-cli@*:
version "1.2.0"
resolved "https://registry.yarnpkg.com/react-native-cli/-/react-native-cli-1.2.0.tgz#9caf3165044ecd80b04b216b62f873168bef1382"
dependencies:
chalk "^1.1.1"
minimist "^1.2.0"
prompt "^0.2.14"
semver "^5.0.3"

react-native-google-analytics-bridge@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/react-native-google-analytics-bridge/-/react-native-google-analytics-bridge-3.1.0.tgz#4869db16e6e18d59f1f4ab6a33e483cc71872421"
Expand Down Expand Up @@ -4393,12 +4358,6 @@ read-pkg@^1.0.0:
normalize-package-data "^2.3.2"
path-type "^1.0.0"

[email protected]:
version "1.0.7"
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
dependencies:
mute-stream "~0.0.4"

readable-stream@^1.1.13, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@~1.1.8, readable-stream@~1.1.9:
version "1.1.14"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
Expand Down Expand Up @@ -4618,17 +4577,13 @@ restore-cursor@^1.0.1:
exit-hook "^1.0.0"
onetime "^1.0.0"

[email protected]:
version "0.1.8"
resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b"

right-align@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
dependencies:
align-text "^0.1.1"

rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.4.3, rimraf@^2.4.4, [email protected]:
rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.4.3, rimraf@^2.4.4:
version "2.5.4"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04"
dependencies:
Expand Down Expand Up @@ -4856,10 +4811,6 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"

[email protected]:
version "0.0.9"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.9.tgz#a8f6eaeca90674c333e7c43953f275b451510695"

stacktrace-parser@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.4.tgz#01397922e5f62ecf30845522c95c4fe1d25e7d4e"
Expand Down Expand Up @@ -5318,17 +5269,6 @@ util-deprecate@^1.0.2, util-deprecate@~1.0.1, [email protected]:
dependencies:
inherits "2.0.1"

[email protected]:
version "0.2.1"
resolved "https://registry.yarnpkg.com/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7"
dependencies:
async "~0.2.9"
deep-equal "*"
i "0.3.x"
mkdirp "0.x.x"
ncp "0.4.x"
rimraf "2.x.x"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8"
Expand Down Expand Up @@ -5498,18 +5438,6 @@ [email protected]:
version "0.1.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"

[email protected]:
version "0.8.3"
resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0"
dependencies:
async "0.2.x"
colors "0.6.x"
cycle "1.0.x"
eyes "0.1.x"
isstream "0.1.x"
pkginfo "0.3.x"
stack-trace "0.0.x"

wordwrap@^1.0.0, wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
Expand Down

0 comments on commit ffaf2e7

Please sign in to comment.