Hi everyone! I have a question about js in modules. Is there is an option to enable js minifying of modules or should I do it myself? I could not find information about it the process of minifying js of modules. If there is no such option, maybe you know some techniques to deal with it? The only option I see is to minify js code manually with some web service and when I need to modify code I unminify it. But that seems not so efficient. Thank you!
Hi @HarryCopter, module JS is minified automatically by Hubspot. It can take a bit of time to see the minified version on live pages after updating your JS though. As per Hubspot documentation: "Every time you update your JavaScript files, we automatically minify them in the background, so there will be a short period before you see the .min.js version of your Javascript files being served on live pages.'
As you can see in the below screenshot from Sources in Dev Tools for my website, the module JS file is minified
Thank you for your reply! You are right, some of the module JS is minified, but some are not(image attached) I thought it was because some js files are too small already so minifying would not impact the performance, but you can see from the image, that the larger JS module is not minified. And the module was not updated in a long time(second image). The second thought that it is because the module was not updated in a long time, I updated it, waited 20 min and still no result I have a list of js that was not minified and all of them was created over a year ago and been updated often through the year Maybe it's because they are just "old" and should be re created to have this feature of minifying?
Thank you so much, @dennisedson, I did what you said and it worked(image attached) All I did is copied the module and put it on a draft page, in addition, I added the original module on the same page. As you can see, the copy got minified, and the original js did not. So what will be the best course of action for me? Remove original and replace all occurrences with the copy?