• Resolved snippet24

    (@snippet24)


    Hi Frank, I have been giving thought to this, I have been reading console.logs can have a big impact on performance. Is it feasible or good idea to remove console.logs from processed javascript files, just like comments are removed. Oj not overriding them with a runtime but actually removing the console.log from code.

    Kind Regards

    • This topic was modified 1 month, 3 weeks ago by snippet24.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    should be possible, but I’m not big fan of possibly breaking stuff that way 😉

    if you want I can provide you with a code snippet that tries removing console.log() and similar for you to try?

    Thread Starter snippet24

    (@snippet24)

    Sure 😉 I can try locally and report any problems that may occur, is it a filter? and removing the code snippet does restore the console.logs right, meaning is temporally.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, I’ll see what I can come up with 🙂

    Thread Starter snippet24

    (@snippet24)

    Alright 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Bad news I’m afraid; I’ve been experimenting a bit and I’m hit a dead end tbh. Sometimes the code is removing too little and sometimes too much (breaking things, as i feared). The reason; there are many ways console.log (and simmilar such as console.warn or .info or .error) are called and used and as javascript is very brittle the chance breaking things is too big really :-/

    Thread Starter snippet24

    (@snippet24)

    Ahh I understand :-/ Thank you Frank for giving it a try nevertheless 🙂

    Kind Regards

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.