问题
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