...
Instead of leveraging your custom.js file to load modules and to execute JS code anywhere, you can add instructions to custom views to load specific AMD modules and optionally execute functions. See KenedoViews and AMD JS Modules.
Using jQuery in your custom modules
...