# Minify JS not working

**URL:** <https://answers.netlify.com/t/minify-js-not-working/19196>\
**Category:** Support\
**Tags:** building\
**Created:** [July 20, 2020, 3:10pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196 "2020-07-20T15:10:07Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![titani](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@titani](https://answers.netlify.com/u/titani)\
**Post date:** [July 20, 2020, 3:10pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/1 "2020-07-20T15:10:07Z")

</div>

**Minify JS** under Deploy Settings, Asset optimization: **isn’t working** for me. I have a plain HTML project, no build tools. CSS is being minified, yet JavaScript is not being minified. Bundle JS works. Please help.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [July 20, 2020, 5:27pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/2 "2020-07-20T17:27:47Z")

</div>

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.

thanks!

---

<div class="post-metadata">

**Author:** ![titani](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@titani](https://answers.netlify.com/u/titani)\
**Post date:** [July 21, 2020, 11:44am UTC](https://answers.netlify.com/t/minify-js-not-working/19196/3 "2020-07-21T11:44:12Z")

</div>

Hello Perry. Thank you. The site is [https://sad-wright-da6669.netlify.app](https://sad-wright-da6669.netlify.app)  
A screenshot of my settings is attached.

 ![Capture](https://global.discourse-cdn.com/netlify/original/2X/2/2461a1ef5dffe2fb297bf27f4edab379164efa7b.png)

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [July 22, 2020, 5:27pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/4 "2020-07-22T17:27:55Z")

</div>

hey titani,

thanks for that. I do indeed see that your JS, located here:

[https://d33wubrfki0l68.cloudfront.net/bundles/57c3aa1413f26f2a0edcc42507aee46792be6397.js](https://d33wubrfki0l68.cloudfront.net/bundles/57c3aa1413f26f2a0edcc42507aee46792be6397.js)

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.

---

<div class="post-metadata">

**Author:** ![titani](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@titani](https://answers.netlify.com/u/titani)\
**Post date:** [July 22, 2020, 6:03pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/5 "2020-07-22T18:03:40Z")

</div>

Very good. Thank you.

---

<div class="post-metadata">

**Author:** ![pspeter3](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/pspeter3/32/15929_2.png) [@pspeter3](https://answers.netlify.com/u/pspeter3)\
**Post date:** [September 15, 2020, 6:36pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/6 "2020-09-15T18:36:48Z")

</div>

Was this ever resolved?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [September 16, 2020, 6:46am UTC](https://answers.netlify.com/t/minify-js-not-working/19196/7 "2020-09-16T06:46:56Z")

</div>

Hi, @pspeter3, I don’t see that it was. @titani, if you want to keep troubleshooting this issue, please let us know.

Do you have content not minified, @pspeter3 ? If so, what is the site name and the URL for the content not minified?

---

<div class="post-metadata">

**Author:** ![proven.design](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/proven.design/32/16150_2.png) [@proven.design](https://answers.netlify.com/u/proven.design)\
**Post date:** [September 21, 2020, 6:05pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/8 "2020-09-21T18:05:23Z")

</div>

Hi @luke, I am having the same issue with my JS not minifying,  
[https://proven.netlify.app/](https://proven.netlify.app/)

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [September 21, 2020, 6:30pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/9 "2020-09-21T18:30:06Z")

</div>

could you post a screenshot of your asset optimization settings please?

---

<div class="post-metadata">

**Author:** ![vimtor](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/vimtor/32/25777_2.png) [@vimtor](https://answers.netlify.com/u/vimtor)\
**Post date:** [May 24, 2021, 2:51pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/10 "2021-05-24T14:51:59Z")

</div>

This is still and issue. Any news on it?

---

<div class="post-metadata">

**Author:** ![freddy](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/freddy/32/4042_2.png) [@freddy](https://answers.netlify.com/u/freddy)\
**Post date:** [May 24, 2021, 4:06pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/11 "2021-05-24T16:06:30Z")

</div>

Is Netlify supposed to minify resources from a third party? The file in question is not hosted with Netlify but pulled directly from cloudfront?

---

<div class="post-metadata">

**Author:** ![madsenfr](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/madsenfr/32/23693_2.png) [@madsenfr](https://answers.netlify.com/u/madsenfr)\
**Post date:** [June 10, 2021, 5:59pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/12 "2021-06-10T17:59:07Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [June 22, 2021, 8:26am UTC](https://answers.netlify.com/t/minify-js-not-working/19196/14 "2021-06-22T08:26:02Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![madsenfr](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/madsenfr/32/23693_2.png) [@madsenfr](https://answers.netlify.com/u/madsenfr)\
**Post date:** [June 22, 2021, 5:35pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/15 "2021-06-22T17:35:51Z")

</div>

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/](https://minify-var.netlify.app/), whereas it use const and let in [https://minify-const-let.netlify.app/](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.

Related post : [[Support Guide] Does Netlify optimize every single asset my site uses? - #23 by hillary](https://answers.netlify.com/t/support-guide-does-netlify-optimize-every-single-asset-my-site-uses/152/23)

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [June 23, 2021, 1:10pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/16 "2021-06-23T13:10:37Z")

</div>

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).

 ![https___minify-var_netlify_app](https://global.discourse-cdn.com/netlify/original/3X/c/2/c23f1101d937d03d227aeab2760d005b4ff12082.png)  
 ![https___minify-const-let_netlify_app](https://global.discourse-cdn.com/netlify/original/3X/7/a/7af362e6e06172d0e93ebcf6d48724da8560ff59.png)

If this is important to you, right now, I’d advise minifying externally. Again, thanks for showcasing this!

---

<div class="post-metadata">

**Author:** ![madsenfr](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/madsenfr/32/23693_2.png) [@madsenfr](https://answers.netlify.com/u/madsenfr)\
**Post date:** [June 23, 2021, 7:58pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/17 "2021-06-23T19:58:20Z")

</div>

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’d rather expect that you take this in account, as most script must not be minified with such widely use JavaScript keywords.  
I undestrand it’s not a priority, but it should at least appears in a roadmap or in a bug list to fix.

---

<div class="post-metadata">

**Author:** ![sam19](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sam19](https://answers.netlify.com/u/sam19)\
**Post date:** [September 20, 2021, 4:00pm UTC](https://answers.netlify.com/t/minify-js-not-working/19196/18 "2021-09-20T16:00:16Z")

</div>

Is this still an issue? My project is also a simple static site using HTML/CSS. No build tools. However, post processing does not work at all. No compression of HTML, CSS and image assets.

Looking for a solution.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [September 22, 2021, 4:42am UTC](https://answers.netlify.com/t/minify-js-not-working/19196/19 "2021-09-22T04:42:03Z")

</div>

Hi @sam19,

Do you have a website URL to share?
