hi there, can you give us a little more information, please? The name of your netlify site (not custom domain) would be helpful - also a screenshot of your asset optimization settings.
Hello Perry. Thank you. The site is https://sad-wright-da6669.netlify.app
A screenshot of my settings is attached.
thanks for that. I do indeed see that your JS, located here:
doesn’t seem to be minified
I am going to let someone else who knows this topic a bit better than I do weigh in. I bet we can figure it out.
Very good. Thank you.
Was this ever resolved?
Do you have content not minified, @pspeter3 ? If so, what is the site name and the URL for the content not minified?
Hi @luke, I am having the same issue with my JS not minifying,
could you post a screenshot of your asset optimization settings please?
This is still and issue. Any news on it?
Is Netlify supposed to minify resources from a third party? The file in question is not hosted with Netlify but pulled directly from cloudfront?
I had the same problem and made some tests.
JS is not minified once you use keywors “const” or “let”, but it works if you declare your variable with “var” instead of “const” and “let”, but it’s oldschool JS.
Does anyone knows if there will be an update any soon ?
Interesting findings! Thanks for digging that up, it’ll be useful when the team invest time in to our post processing features. Nothing to report just yet however we appreciate the outreach!
Here are 2 examples that demonstrate the problem very simply.
It’s the same very small and simple website, just using var in https://minify-var.netlify.app/, whereas it use const and let in https://minify-const-let.netlify.app/
Everything is explained in the website itself to see the original script and the one on CDN.
You will notice that var is minified whereas const & let are NOT.
Interesting find! Must be some logic in the minifier to not minify for const/let (491 v 762 bytes) as they’re both handled by our post processing (served from Cloudfront).
If this is important to you, right now, I’d advise minifying externally. Again, thanks for showcasing this!
I knew it was processed, because scripts are on CDN.
This is an example, but my real scripts are must larger, but as they use const and let, they are not minified.
It was quite interesting not to do minify by my side and let Netlify do it.
I undestrand it’s not a priority, but it should at least appears in a roadmap or in a bug list to fix.