I have this really massive index.js file, around 7000 lines long. I'm looking to break it up into separate files for easier editing purposes. It doesn't matter if Rails combines them back into one file later on, I just need some advice on how to split them up.
Currently, my application.js manifest file includes index.js along with other JavaScript files. However, due to my lack of experience in Ruby on Rails, the index.js file has become unmanageably large. Can anyone offer any useful tips on how to approach this?
The index.js file looks something like this:
"use strict";
(function($) {
//some setup string vars and arrays
//some object definition
//some object definition
//some object definition
//some object definition
//some conditions to init those objects
})(jQuery)
Specifically, I am aiming to move the following code snippet to a separate file:
//some object definition
If anyone could assist with this task, it would be greatly appreciated.