mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 08:55:25 +08:00

The main difference is that Sprockets 4.0 no longer tries to compile everything by default. This is good for us, because we can remove all our custom 'exclusion' logic which was working around the old sprockets 3.0 behavior. The other big change is that lambdas can no longer be added to the `config.assets.precompile` array. Instead, we can do the necessary globs ourselves, and add the desired files manually. A small patch is required to make ember-rails compatible. Since we plan to remove this dependency in the near future, I do not intend to upstream this change. I have compared the `bin/rake assets:precompile` output before and after this change, and verified that all files are present.
13 lines
513 B
Ruby
13 lines
513 B
Ruby
# frozen_string_literal: true
|
|
|
|
# One of the initializers in `discourse-ember-rails/lib/ember_rails.rb` tries to set
|
|
# the ember template compiler path based on a call to `Sprockets::Environment#resolve`
|
|
# which started returning an array in Sprockets 4.
|
|
# This doesn't seem to be needed - it was setting to the existing value, so we can just ignore it.
|
|
Ember::Handlebars::Template.singleton_class.prepend(Module.new do
|
|
def setup_ember_template_compiler(path)
|
|
return if path.is_a? Array
|
|
super
|
|
end
|
|
end)
|