Open jfrux opened 11 years ago
This could be cleaned up, so I'll get on that.
What I'm doing is installing components with bower:
bower
bower install d3 cubism
then adding those paths to config.ru:
config.ru
map '/assets' do environment = Sprockets::Environment.new environment.append_path 'components/jquery' environment.append_path 'components/d3' environment.append_path 'components/cubism' environment.append_path 'components/bootstrap/bootstrap/' environment.append_path 'assets' run environment end
// application.css //= require css/bootstrap.min //= require_tree .
// application.js //= require jquery //= require d3.min //= require cubism.v1 //= require_tree .
I use require_tree to keep site_specific assets in the css and js dirs, e.g. a site.js gets included automatically, or it is good for dropping in quick javascript tests. It's quite a bit of flexibility.
require_tree
...and then I realized I am answering the wrong question. I had no idea there was a sinatra-sprockets gem. It's late. :clock1:
I'll look into this.
This could be cleaned up, so I'll get on that.
What I'm doing is installing components with
bower
:then adding those paths to
config.ru
:I use
require_tree
to keep site_specific assets in the css and js dirs, e.g. a site.js gets included automatically, or it is good for dropping in quick javascript tests. It's quite a bit of flexibility.