javascript - Ruby on rails split index.js to separate files -
i have huge index.js file, 7000 lines, , want split separate files, dont care if assembled rails 1 file, need separate them easier editing.
i have application.js manifest file includes index.js , many more javascript files, index.js became big since i'm not ruby on rails guy, can please give me useful advise on it?
index.js is:
"use strict";
(function($) { //some setup string vars , arrays //some object definition //some object definition //some object definition //some object definition //some conditions init objects })(jquery)
so
//some object definition
i want move separated files.
in application.js
file can call following load individual files
//= require customjsfile1 //= require customjsfile2 ...
if want call them in erb instead <%= javascript_include_tag "customjsfile1", "data-turbolinks-track" => true %>
Comments
Post a Comment