Hi there.
I recently encountered a problem with automatic JS formatting from HubSpot’ s side.
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
{{ 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')) }}
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 jquery_3_3_1_min.min.js . Furthermore, it changes the code inside. For example:
!function(e,t){"use strict";"object"==typeof module&&"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");
is changed to
!function(b,a){"object"==typeof module&&"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")
And it causes JS to not function due to error - ReferenceError: a is not defined
Is there a way to stop Hubspot from minifying this or some other way to replace the older jQuery libraries to newest ?