• Resolved Anonymous User 14978628

    (@anonymized-14978628)


    Really good plugin that removes all whitespace. Just wondering though if it’s possible to output all content on a single line? The plugin WP Rocket does this and i find this functionality very useful. Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Tim Eckel

    (@teckel)

    It only outputs multiple lines when you have JavaScript on your page. I do this because in JavaScript the semicolon is optional. Therefore, there’s not a simple way of knowing what to do with JavaScript minification without a much more complex (and much slower) function.

    Typically, there’s very little JavaScript on a page so the trade-off between a few lines (just a few bytes) and a much slower and complex script which risks breaking JavaScript is an easy decision (for me at least).

    I just looked at two of my sites and there were only 2 lines, only caused by Google Analytics JavaScript code. As most JavaScript should be in it’s own file, I feel this is a good trade-off for speed and reduced complexity.

Viewing 1 replies (of 1 total)
  • The topic ‘Output To Single Line’ is closed to new replies.