digitalsparky / jekyll-minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
GNU General Public License v3.0
245 stars 25 forks source link

Remove JS comments #21

Closed jp26jp closed 6 years ago

jp26jp commented 7 years ago

Since JS comments don't get removed, any JS comments made using // end up commenting out the rest of the file.

digitalsparky commented 7 years ago

Hi, Thanks for your comment, will have a look into this issue and get back to you when I'm able to.

digitalsparky commented 7 years ago

Can you expand on where these issues are occurring so I know which library to look at? jeykll-minifier is essentially a wrapper to 3 different libraries, Uglifier for .js files, cssminify2 for .css files, and htmlcompressor for html and internal html/js/css content, so I need to see where this is actually happening, and potentially raise an issue with the upstream library.

jp26jp commented 7 years ago

It's doing this to pure JS files so I guess that would mean uglifier? I had excluded compression of html and css in the settings when I ran into this issue.

jp26jp commented 7 years ago

It also only happens if the js file uses the yaml front matter blocks. Here's an example.

fermin-silva commented 7 years ago

Same thing for me

---
---
// Theme JavaScript

(function($) {
...more things here

This results as a one line js starting with //, which of course does not work

rkbhochalya commented 6 years ago

Any update? I'm having same issue.

kenman345 commented 6 years ago

i'm having this issue too. I have to wrap it in Githubissues.

  • Githubissues is a development platform for aggregating issues.