Code Dynamically Loading doctype JS file

Dear All,

can any body guide me where is the code written to load js file dynamically and it is giving name VM .

I have observed that when erpnext loads its source only load erpnext.min.js and frappe.min.js.
actually i want to debug and check my code to resolve logicall error in my code.
System auto loads like sales_invoice.js ad VM thats why i am not able to debug onload functionality which is written in sales_invoice.js file.

Thanks and best regards,

Thanks buddy.
Now i can fins whats wrong with my code why things are not working in my custom module.