If you want to make Javascript into a file, then you should use this feature so that your script can be read by the system.

Example 

$this->load_js[] = asset("my_js_folder/my_js_custom.js");