In development environment, it works good. However, after I deployed the system into production with asset-pipeline enabled, it can not require my own js file.
In app/views/layouts/application.html.erb, I included:
<%= requirejs_include_tag "application" %>
and in app/assets/application.js.coffee, I included:
require [
'questions'
]
and I do have the file: app/assets/javascripts/questions.js.coffee, but it can not find it in production environment.
I have tried to add the following line into config/environments/production.rb
config.assets.precompile += %w( questions.js )
but even with this config, the compiled questions.js was renamed with fingerprint appended.
So I this this might be a potential issue of requirejs-rails, which does not take fingerprint into consideration? Or it might be my error configuration.
@renoqiu You need to say <%= requirejs_include_tag "questions" %> while using the module and exclude configuration keywords. See this document for usage. I'll reopen if you're still confused.
In development environment, it works good. However, after I deployed the system into production with asset-pipeline enabled, it can not require my own js file.
In app/views/layouts/application.html.erb, I included:
<%= requirejs_include_tag "application" %>
and in app/assets/application.js.coffee, I included:
and I do have the file: app/assets/javascripts/questions.js.coffee, but it can not find it in production environment.
I have tried to add the following line into config/environments/production.rb
config.assets.precompile += %w( questions.js )
but even with this config, the compiled questions.js was renamed with fingerprint appended.
So I this this might be a potential issue of requirejs-rails, which does not take fingerprint into consideration? Or it might be my error configuration.