Removing JavaScript Debugging in Production with Laravel Elixir

While using Gulp with Laravel’s Elixir, I found while it minifies/uglifies JavaScript on a production build, it doesn’t strip JavaScript debugging. It was also far more time consuming to implement this as a custom Task or Extension.

Stripping debugging allows you to freely use Console.debug() and similar debugging calls in development, which otherwise will reduce the performance of your JavaScript application, and in some cases make them completely unusable to certain browsers.

So I did it myself, and made a Pull request (Github) with the official Laravel Elixir repository, which was approved. Nice to give back.

Github Pull Request for Laravel Elixir