If you are using js either in custom module or any other place , please paste all your js file in base.html for global purpose and then include that base.html in template.
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.