1

During asset:precompile ember-cli-rails will build the ember app into tmp/ember-cli/apps/<appname>. This places the app in <appname>-<hash>.js in the compiled app assets (that is in tmp/ember-cli/<appname>/assets/<appname>-<hash>.js). include_ember_script_tags <:appname> will ask for the correct assets/<appname>-<hash>.js but this will not be served by a productions server configured to let assets be served by Apache/Nginx.

Shouldn't the ember-cli-rails compile the app into public/assets in production mode, so they are visible to Apache/Nginx?

Or should I set rails to serve the app from where ember-cli-rails place it:

config.serve_static_assets = true
config.assets.paths << Rails.root.join('tmp', 'ember-cli', 'apps', '<appname>', 'assets')
Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • Good question, I've asked that also in to the Issue Tracker of ember-cli-rails: https://github.com/thoughtbot/ember-cli-rails/issues/505 – phortx Dec 16 '16 at 11:18
  • FYI i ended up enhancing the 'assets:pre compile' task to copy the ember build artifacts into public – Remus Rusanu Dec 16 '16 at 11:25

1 Answers1

0

Add this setting to config/initializers/ember.rb to compile the assets to the public folder.

# config/intializers/ember.rb                                                                                 
EmberCli.instance_variable_set(:@root, Rails.root.join("public/assets/ember-cli").tap(&:mkpath))              
freedrull
  • 2,194
  • 4
  • 21
  • 33