Use require to add the JavaScript on the page. Make sure that it's still only added/loaded if in developer mode.