Dec 17, 2020 4:23 AM
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.
Dec 17, 2020 7:26 AM
As you can see in the below screenshot from Sources in Dev Tools for my website, the module JS file is minified
Dec 17, 2020 9:56 AM
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?
Dec 18, 2020 12:28 PM
Dec 21, 2020 5:09 AM
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?
Dec 21, 2020 9:41 AM
Good to know.
One more tests just to try to save you from having to replace the module with the clone everywhere. Unsure how many copies you have out there
Have you tried to modify the js in the original module? Maybe add a console.log?