<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding jQuery 3 / How to prevent JavaScript automatic minifying in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/395545#M20221</link>
    <description>&lt;P&gt;This original post is a couple years old but In-case anyone stumbles onto it I want everyone to know using &lt;CODE&gt;|replace&lt;/CODE&gt; on &lt;CODE&gt;standard_header_includes&lt;/CODE&gt; is not the best way to solve this problem.&lt;BR /&gt;&lt;BR /&gt;If you want to use the latest version of jQuery I suggest &lt;A href="https://developers.hubspot.com/cms/guides/jquery/upgrade" target="_blank" rel="noopener"&gt;following our guide to doing just that&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Regarding minification, we hear ya. Right now we would suggest not minifying files before uploading, preventing files from minifying twice. We're investigating ways that may make it so you can control this but it's not a sure-fire thing and we have no timeline.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Dec 2020 14:33:22 GMT</pubDate>
    <dc:creator>jmclaren</dc:creator>
    <dc:date>2020-12-23T14:33:22Z</dc:date>
    <item>
      <title>Adding jQuery 3 / How to prevent JavaScript automatic minifying</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/206608#M8245</link>
      <description>&lt;P&gt;Hi there.&lt;BR /&gt;&lt;BR /&gt;I recently encountered a problem with automatic JS formatting from HubSpot' s side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im am disabling loading jQuery old version which is automaticly included and adding JQuery 3.3.1. Im doing this trough a hubl template, replacing&lt;/P&gt;&lt;PRE&gt;      	{{ standard_header_includes|replace('/hs/hsstatic/jquery-libs/static-1.4/jquery/jquery-1.11.2.js', get_public_template_url('appxite_2018/js/vendor/jquery_3_3_1_min.js')) }}&lt;/PRE&gt;&lt;P&gt;While the browser clearly shows that the new jQuery is loaded and the old one is not, first I noticed that it changes the file from jquery_3_3_1_min.js to&amp;nbsp;jquery_3_3_1_min.min.js . Furthermore, it changes the code inside. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;!function(e,t){"use strict";"object"==typeof module&amp;amp;&amp;amp;"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");&lt;/PRE&gt;&lt;P&gt;is changed to&lt;/P&gt;&lt;PRE&gt;!function(b,a){"object"==typeof module&amp;amp;&amp;amp;"object"==typeof module.exports?module.exports=b.document?a(b,!0):function(c){if(!c.document){throw new Error("jQuery requires a window with a document")&lt;/PRE&gt;&lt;P&gt;And it causes JS to not function due to error -&amp;nbsp;&lt;SPAN class="message-body-wrapper"&gt;&lt;SPAN class="message-flex-body"&gt;&lt;SPAN class="message-body devtools-monospace"&gt;ReferenceError: a is not defined&lt;BR /&gt;&lt;BR /&gt;Is there a way to stop Hubspot from minifying this or some other way to replace the older jQuery libraries to newest ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 08:04:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/206608#M8245</guid>
      <dc:creator>MartinsC</dc:creator>
      <dc:date>2018-09-13T08:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding jQuery 3 / How to prevent JavaScript automatic minifying</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/206646#M8247</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/68151"&gt;@MartinsC&lt;/a&gt;&amp;nbsp;- Just use the unminified version of jQuery &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://code.jquery.com/jquery-3.3.1.js" target="_blank"&gt;https://code.jquery.com/jquery-3.3.1.js&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 11:22:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/206646#M8247</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-09-13T11:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding jQuery 3 / How to prevent JavaScript automatic minifying</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/395545#M20221</link>
      <description>&lt;P&gt;This original post is a couple years old but In-case anyone stumbles onto it I want everyone to know using &lt;CODE&gt;|replace&lt;/CODE&gt; on &lt;CODE&gt;standard_header_includes&lt;/CODE&gt; is not the best way to solve this problem.&lt;BR /&gt;&lt;BR /&gt;If you want to use the latest version of jQuery I suggest &lt;A href="https://developers.hubspot.com/cms/guides/jquery/upgrade" target="_blank" rel="noopener"&gt;following our guide to doing just that&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Regarding minification, we hear ya. Right now we would suggest not minifying files before uploading, preventing files from minifying twice. We're investigating ways that may make it so you can control this but it's not a sure-fire thing and we have no timeline.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 14:33:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Adding-jQuery-3-How-to-prevent-JavaScript-automatic-minifying/m-p/395545#M20221</guid>
      <dc:creator>jmclaren</dc:creator>
      <dc:date>2020-12-23T14:33:22Z</dc:date>
    </item>
  </channel>
</rss>

