sindresorhus / strip-debug

Strip console, alert, and debugger statements from JavaScript code
MIT License
84 stars 15 forks source link

Add options? #10

Closed DaveAtDog closed 9 years ago

DaveAtDog commented 9 years ago

It'd be great if you could pass options to strip-debug. In my use case I need the alert() call to remain in the production code.

e.g: stripDebug(['console','debugger']) would leave the alerts in place.

sindresorhus commented 9 years ago

Already answered in other issues. Not interested in options. If you use alert() in production, you're doing it wrong.

DaveAtDog commented 9 years ago

I'm now re-thinking how to implement my alerts but in the short term I've tweaked your otherwise very useful script thusly: // stripAlert(node); ;)

Cheers, Dave

sindresorhus commented 9 years ago

You should use inline/context notifications. alert() has a LOT of downsides: http://stackoverflow.com/a/8825479/64949