darkhelmet / sinatra-bundles

Easy asset packaging for sinatra
http://verboselogging.com/2010/01/13/sinatra-bundles-easy-asset-bundling-for-sinatra
MIT License
42 stars 8 forks source link

Possible to guarantee bundling order of bundled JS? #17

Open jm3 opened 13 years ago

jm3 commented 13 years ago

I have 3 JS files i'm bundling, and file 3 must be bundled after files 1 and 2.

Is there a way to make sinatra-bundles respect the order of the files to be bundled as passed to javascript_bundle?

darkhelmet commented 13 years ago

They are bundled in order, so simply listing them in the order you want is enough.

javascript_bundle(:all, %w(jquery lightbox blog))

lightbox depends on jquery, blog depends on lightbox and jquery.

jm3 commented 13 years ago

On my box, using =0.5.1, no, they don't bundle in the requested order (hence me filing the bug).

darkhelmet commented 13 years ago

What order to they bundle in? Are you listing a file that doesn't exist? I think in that case, it just won't get picked up (should probably change that...).

Can you replicate it with a minimal setup? There is a unit test test for the correct ordering (which passes), and I can't see any problem in the code that would cause this, so I need more info to proceed.

jm3 commented 13 years ago

I spent an hour trying to get a minimal test case working last night but for some reason that i can't fathom, now the javascript_bundle_include_tag method is not even being found, even though sinatra and sinatra bundles are both being gem bundled. I'll try again and post an example if I can get it working.