rstacruz / sinatra-assetpack

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

rake assetpack:build generates empty files #195

Open dgmstuart opened 9 years ago

dgmstuart commented 9 years ago

When I run rake assetpack:build, it generates files for everything in my assets directory, but they're all totally empty

here's my rakefile:

APP_FILE  = 'app.rb'
APP_CLASS = 'Sinatra::Application'

require 'sinatra/assetpack/rake'

And the section from app.rb:

require 'sinatra'
require 'sinatra-initializers'
require 'sinatra/assetpack'
require 'sass'

register Sinatra::Initializers
register Sinatra::AssetPack

use Rack::Auth::Basic, "Restricted Area" do |username, password|
  username == ENV["BASIC_AUTH_USERNAME"] and password == ENV["BASIC_AUTH_PASSWORD"]
end

# Allow @import to work correctly by telling sinatra where to look
#   Without this it tries to do imports relative to *this* file
set :scss, { :load_paths => [File.expand_path('../assets/stylesheets', __FILE__)] }

assets do
  serve '/images', :from => "assets/images"

  serve '/js', :from => 'assets/javascripts'
  js :application, [
    '/js/plugins.js',
    '/js/main.js',
  ]
  js :jquery, [
    '/js/jquery.min.js'
  ]
  js :modernizr, [
    '/js/modernizr.js'
  ]
  js :selectivizr, [
    '/js/selectivizr.js'
  ]

  serve '/css', :from => 'assets/stylesheets'
  css :application, [
    '/css/screen.css'
   ]

  js_compression :jsmin
  css_compression :sass
end

get '/' do
  erb :index
end

#etc.