Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

config.assets.precompile does not correctly process Coffeescript files #4430

Closed
andrewhao opened this Issue Jan 12, 2012 · 1 comment

Comments

Projects
None yet
1 participant

Running a Rails 3.1.3 app. Javascript file structure as follows:

app
  assets
    javascripts
      application.js.coffee
      foo.js.coffee
      bar.js

In production.rb:

  # This adds all *.js and *.js.coffee files to the precompile array.
  js_files = Dir.glob(File.join(Rails.root, 'app', 'assets', 'javascripts', '*.js*')).map { |n| File.basename n }
  config.assets.precompile += js_files

Now when I run RAILS_ENV=production bundle exec rake assets:precompile, I see bar.js and application.js, but not foo.js. I expect to see foo.js compiled as well.

Perhaps I'm misunderstanding the issue. Seems like at this point, all preprocessors have been run (.js.coffee -> .js).

I worked around this issue by using this expression:

config.assets.precompile << /[^\/]+.js/

Closing. Would appreciate more documentation around assets.precompile

@andrewhao andrewhao closed this Jan 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment