Rails specify load order of javascript files?

后端 未结 1 432
花落未央
花落未央 2021-01-01 13:07

In my application.js file, I have:

//= require jquery
//= require jquery_ujs
//= require underscore
//= require backbone
//= require_tree .
//
//= require ./         


        
相关标签:
1条回答
  • 2021-01-01 13:52

    You've still got a

    //= require_tree .
    

    Higher up, which is loading everything, apparently in alphabetical order. Remove that (obviously making sure that everything is required elsewhere) and you should be fine. You might be able to make that the last line of your application.js but I don't remember the specified behaviour when two statements end up requiring the same file

    0 讨论(0)
提交回复
热议问题