Laravel Elixir: How to complete a task only in production mode?

I use a bunch of "console.log" to debug my JS application. However, I would like to delete them automatically when sending the code to a file.

Using the traditional gulpfile, I would use the plugin "gulp -strip-debug", which will only run when the main task of "production" is completed.

When using Laravel Elixir, however, this is slightly different. I use the --production flag to minimize my assets, but after that I would like to complete the task of debugging the strip. I could not find how to do this in the Laravel 5.1 documentation.

+4
source share
1

elixir.config , --production elixir.config.production true.

, if(elixir.config.production), , "", --production .

+5

All Articles