• Resolved amatheson

    (@amatheson)


    I’ve got a plugin with an already minified JS file (WP Recipe Maker Premium’s public-elite.js). For whatever reason, one of the functions in this JS file looks for a starting comment (‘/*’) to do something which isn’t relevant here. However, this comment string in the middle of the file causes the minification parser to incorrectly strip out the rest of the JS file after that point resulting in a broken combined/minified file. I’ve worked around this for now by excluding that JS file from optimization but I’d like to know if there is a way to add it into the combined JS file without it also going through the minifier. Any thoughts appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Hai Zheng?

    (@hailite)

    Hi,

    Please disable Remove Comments in Optimize tab. If it doesn’t work, that means the JS comment is removed in minify engine.

    Does that JS filename contain .min. or -min.? If so, it will be automatically bypassed the JSMin minify engine and just combine. If not, is it possible to rename it to have it?

    Thread Starter amatheson

    (@amatheson)

    Thanks, Hai – I will dequeue the file from WP Recipe Maker and re-register a copy in my theme with the .min.js extension. I will also open a ticket with WP Recipe Maker to ask them to add the .min. to the filename.

    • This reply was modified 5 years, 10 months ago by amatheson.
    Thread Starter amatheson

    (@amatheson)

    An update – I tried it with the file as ‘.min.js’ but had the same issue. Disabling Remove Comments solved the problem, but it would be good to strip the comments from other files.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Combine already minified JS file without minifying again?’ is closed to new replies.