rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 96 forks source link

Heroku Support #20

Closed bradherman closed 13 years ago

bradherman commented 13 years ago

How exactly is this supposed to support heroku? I have it configured to serve assets from our public directory, but on deploy to heroku, we always get 404's to the path. I know heroku is a read-only file system, so how does it go about creating the minified files?

bradherman commented 13 years ago
  js :issues_js, [
    '/javascripts/jquery.min.js',
    '/mproducts/javascripts/underscore-min.js',
    '/mproducts/javascripts/backbone-min.js',
    '/javascripts/issues.js'
  ]

  css :issues_css, [
    '/stylesheets/issues/screen.css'
  ]

  js_compression  :jsmin
  css_compression :sass
 prebuild true

added map_public_dir :assets to our config file

bradherman commented 13 years ago

Also our folder structure is as follows:

app ->
  issues_app.rb
public ->
  javascripts ->
    files
  stylesheets ->
    files
  mproducts ->
    files
rstacruz commented 13 years ago

You're missing:

    serve '/javascripts', from: 'public/javascripts'
    serve '/stylesheets', from: 'public/stylesheets'
    serve '/mproducts', from: 'public/mproducts'

by default, it looks at app/js, app/css, and app/images.

...and make sure the app's :root is in ./ and not ./app.

rstacruz commented 13 years ago

...And how it works is that it stores the minified files in memory, which are built on startup. :)

bradherman commented 13 years ago

Awesome! Thanks for the help!