terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
376 stars 30 forks source link

Can't seem to get to work with Jquery in a file. #130

Closed bad-jesus closed 1 year ago

bad-jesus commented 2 years ago

I keep getting parsing errors when trying to use this on a file with Jquery.

Parse Error: < 0 ? this[ num + this.length ] : this[ num ];

Anyone else running into this?

DanielRuf commented 2 years ago

Hi,

thanks for reporting this issue.

Can you please provide a reproducible test case as html file or similar and provide the exact steps to reproduce? You can also test on https://terser.org/html-minifier-terser/

bad-jesus commented 2 years ago

Sorry, I should have included more info.

If you copy and paste jquery and try and min it, you get the error.

Screenshot :

@.***

From: Daniel Ruf @.> Sent: Tuesday, July 26, 2022 2:47 PM To: terser/html-minifier-terser @.> Cc: jamie kembel @.>; Author @.> Subject: Re: [terser/html-minifier-terser] Can't seem to get to work with Jquery in a file. (Issue #130)

Please provide a reproducible test case as html file or similar and provide the exact steps to reproduce.

You can test on https://terser.org/html-minifier-terser/

— Reply to this email directly, view it on GitHubhttps://github.com/terser/html-minifier-terser/issues/130#issuecomment-1195963983, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFZZXDVA43M7FDXDHDHHFWTVWBFDDANCNFSM54WY4L2Q. You are receiving this because you authored the thread.Message ID: @.**@.>>

DanielRuf commented 2 years ago

For me it works there:

Bildschirmfoto 2022-07-26 um 23 36 06

Please make sure to use html files with <script> tags in them, so that html-minifier can compress these blocks with terser. All js compression logic comes from terser directly.

bad-jesus commented 2 years ago

Hi Daniel, I tried to set up something to share, but it is rather involved as it is being used as part of a project.

because the file was not being included in an HTML, having the Githubissues.

  • Githubissues is a development platform for aggregating issues.