Control order of script concatenation using Brunch

↘锁芯ラ 提交于 2019-12-10 02:34:52

问题


What is the best practice for controlling the order in which scripts / stylesheets are concatenated when using Brunch?

A simple version of my problem involves an application using Twitter Bootstrap, which requires jQuery. Bootstrap requires that jQuery is loaded first.

Initially I had the following in my vendor/ directory: jquery-1.9.1.min.js and bootstrap.min.js

Which was concatenated by Brunch into my vendor.js file in alphabetical order, namely, bootstrap first.

To solve this I appended a number to the beginning of each script to designate the order in which I wanted them to concat -- 1-jquery-1.9.1.min.js and 2-bootstrap.min.js

I haven't been able to find information on how to do this more elegantly but I can't imagine that's the best way to accomplish this. Thanks for any help!


回答1:


you can set order of concatenation in config

http://brunch.io/docs/config#-files-



来源:https://stackoverflow.com/questions/16474236/control-order-of-script-concatenation-using-brunch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!