File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -222,15 +222,23 @@ def precompiled_assets
222
222
@precompiled_assets ||= begin
223
223
assets = Set . new
224
224
225
- filters = ( assets_precompile || [ ] ) . map { |f |
226
- Sprockets ::Manifest . compile_match_filter ( f )
227
- }
228
-
229
- env = assets_environment
230
- env . logical_paths do |logical_path , filename |
231
- if filters . any? { |f | f . call ( logical_path , filename ) }
232
- env . find_all_linked_assets ( filename ) do |asset |
233
- assets << asset
225
+ paths , filters = ( assets_precompile || [ ] ) . flatten . partition { |arg | Sprockets ::Manifest . simple_logical_path? ( arg ) }
226
+ filters = filters . map { |arg | Sprockets ::Manifest . compile_match_filter ( arg ) }
227
+
228
+ env = assets_environment . cached
229
+
230
+ paths . each do |path |
231
+ env . find_all_linked_assets ( path ) do |asset |
232
+ assets << asset
233
+ end
234
+ end
235
+
236
+ if filters . any?
237
+ env . logical_paths do |logical_path , filename |
238
+ if filters . any? { |f | f . call ( logical_path , filename ) }
239
+ env . find_all_linked_assets ( filename ) do |asset |
240
+ assets << asset
241
+ end
234
242
end
235
243
end
236
244
end
You can’t perform that action at this time.
0 commit comments