Use sprockets 3/4 style manifest.js #1759
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sprockets 4 is coming along and is currently
4.0.0.beta4
. They have a nice upgrade doc, and some really great features (source maps, built-in babel+es6).One issue is that sprockets 4 doesn't seem to support "wildcards" (like
spree/backend/all*
) in theconfig.assets.precompile
list. It wasn't obvious, but it's clear this removal was intentional. The behaviour was listed in sprockets 3.x as deprecated and was in legacy.rb.The sprockets upgrade notes push for using a
app/assets/config/manifest.js
instead of loading files into theprecompile array
, which seems reasonable. We can do the same, but we need a unique name so we don't collide withIn lieu of wildcards, we can use
link_tree
in most cases. This handles images cleanly.The obvious ugliness is that we need to explicitly reference all our select2 locale files. I don't think there's a way around this while still using the
select2-rails
gem. We can't uselink_tree
because the relative path is unknown (in a gem). One solution would be to embedselect2-rails
in thevendor/assets
directory (which we might want to do anyways).