jwhitley / requirejs-rails

RequireJS support for your Rails 3 or 4 application
MIT License
592 stars 202 forks source link

Support custom Sprockets manifest filenames #249

Closed agis closed 7 years ago

agis commented 9 years ago

In Rails 4, if config.assets.manifest is set, it must include the manifest's filename. For example:

config.assets.manifest = "public/assets/manifest-foo.json"

This change adds support for Rails 4 apps that have set their manifest to a custom one.

Note that while it's invalid for the manifest option to not include the filename in Rails 4, we are more forgiving and also accept values that don't contain the filename, in order to preserve backwards compatibility with previous requirejs-rails versions and Rails 3 apps.

agis commented 8 years ago

@carsomyr Any change this is going to be merged soon? We've been using it in production for months now and we'd like to switch from our fork. Thanks!

Deradon commented 8 years ago

Any news here? We have the same problem.

Doing something like:

config.assets.manifest = Rails.root.join('config', 'custom-manifest.json')

as it is described in Configuring Rails Applications

config.assets.manifest defines the full path to be used for the asset precompiler's manifest file. Defaults to a file named manifest-.json in the config.assets.prefix directory within the public folder.

Using the correct way to specify the manifest file will break requirejs-rails. Any plans to fix it?

agis commented 7 years ago

@carsomyr any news on this one?

carsomyr commented 7 years ago

@agis- Could you move the Rails 3 portion of the code (line 39 to 46) into the Rails 3 part of the if statement?

agis commented 7 years ago

@carsomyr Not sure I understand. Lines 39-46 are valid for both rails versions (3 & 4). Where would you like them to be moved? Inside this branch? If so, I don't think this will work, since we also want them to apply to Rails 4 apps.

carsomyr commented 7 years ago

@agis You should be good to go.