Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control order of script concatenation using Brunch

Tags:

brunch

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!

like image 870
Gilman Avatar asked May 10 '13 02:05

Gilman


1 Answers

you can set order of concatenation in config

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

like image 131
Paul Miller Avatar answered Oct 06 '22 22:10

Paul Miller