问题
I currently have a file app/assets/javascripts/application.js
which has a list of requires in it, and which, when i run rake assets:precompile
cleans, minifies and concatenates all of the listed files into public/assets/application.js
. That's all working fine.
However, i want to add another precompiled js file called 'show_tale.js', with a different list of js files to pull in. I've added a show_tale.js
file into app/assets/javascripts
which has the list of requires in it. But, when i do rake assets:precompile
, it doesn't build a public/assets/show_tale.js
file like i want it to.
I'm guessing that in some config file i need to add 'show_tales' or 'show_tales.js' into some list or option, but i can't work out where/how to do this. Can anyone set me straight?
thanks, max
回答1:
Found it, it was pretty obvious really. It's been a long week :) In config/environments/production.rb
:
config.assets.precompile += %w( show_tale.js )
来源:https://stackoverflow.com/questions/8272325/sprockets-and-rails-3-adding-a-new-precompiled-js-file