common-shakeify
common-shakeify copied to clipboard
shakes out functions that I used
I'm not sure if this plugin in production ready yet, but it seems that it removed functions that I'm definitely using.
Using import to get the modules, but running babel as a browserify transform, so that should rewrite everything to require.
seems that most of the incorrectly removed functions are from the crypto-browserify
package.
Some of Babel's module transform output may be tripping up common-shake. Could you share an example that shows it failing?
Hi - I'm running into this issue too - I threw together a project that reproduces the issue here: https://github.com/retail-robot/common-shakeify-issue-12-repro
You should be able to clone it and just npm install
+ npm run build
Thanks @retail-robot! this
is really hard to make work correctly in all situations, but that particular case should not be too difficult to support.
Hey,
Sorry I wasn't able to provide any code. I'll try to test the fix on my usecase if I can!
Op vr 20 apr. 2018 19:41 schreef Renée Kooi [email protected]:
Thanks @retail-robot https://github.com/retail-robot! this is really hard to make work correctly in all situations, but that particular case should not be too difficult to support.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/browserify/common-shakeify/issues/12#issuecomment-383170318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF3fs7gYvru8sLvV8rPWp_1vVZLQE2Yks5tqh21gaJpZM4ROwoG .
np, @goto-bus-stop - thanks!
hi! we just ran into this too with the sbd library.
it is stripping out /lib/Match.js:isCaptialized
, even though that function is called via this
within the code.
09:42:00 ~/src/sbd:master
↳ npx browserify -p common-shakeify lib/tokenizer.js > shake.js
09:42:07 ~/src/sbd:master
↳ npx browserify lib/tokenizer.js > no-shake.js
09:45:03 ~/src/sbd:master
↳ grep isCapitalized shake.js
/* common-shake removed: exports.isCapitalized = */ void function(str) {
return this.isCapitalized(str) || /``|"|'/.test(str.substring(0,2));
return this.isCapitalized(str);
if (wordCount < 5 && words[0].length < 6 && this.isCapitalized(words[0])) {