Would a setting on javascript compression to remove console.log() for production be useful to other users of this module?

I recognize there are different views on whether console.log() in production code is a bad thing. Still, it is probably quite common developers to want debug code on their dev platform while site admins want to be sure the log statements are removed in order to get smaller files and best performance.

If the module owners and community feel this would be a useful feature, I'd be glad to look in to creating a more detailed proposal and patch for that sort of functionality.

Comments

kdebisschop created an issue. See original summary.

NickDickinsonWilde’s picture

Status: Active » Postponed

I don't see a problem including that but I don't have the time to do so myself - do a patch and I'll take a look.

NickDickinsonWilde’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Postponed » Needs work

With 8.-3.x's new architecture, this would now be very easy.
I may get to it in a while but if not, super easy via the same method as the optimizers.

NickDickinsonWilde’s picture

Status: Needs work » Fixed

Done in 8.x-3.x in the Modifier submodule.
Very minimally tested so far so it may have unexpected results.

  • NickWilde committed 8d7e560 on 8.x-3.x
    Issue #2830672 by NickWilde: Can we add a setting to remove console.log...
NickDickinsonWilde’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.