File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,17 @@ class Engine < ::Rails::Engine
20
20
end
21
21
22
22
initializer "importmap.reloader" do |app |
23
- Importmap ::Reloader . new . tap do |reloader |
24
- reloader . execute
25
- app . reloaders << reloader
26
- app . reloader . to_run { reloader . execute }
23
+ unless app . config . cache_classes
24
+ Importmap ::Reloader . new . tap do |reloader |
25
+ reloader . execute
26
+ app . reloaders << reloader
27
+ app . reloader . to_run { reloader . execute }
28
+ end
27
29
end
28
30
end
29
31
30
32
initializer "importmap.cache_sweeper" do |app |
31
- if app . config . importmap . sweep_cache
33
+ if app . config . importmap . sweep_cache && ! app . config . cache_classes
32
34
app . config . importmap . cache_sweepers << app . root . join ( "app/javascript" )
33
35
app . config . importmap . cache_sweepers << app . root . join ( "vendor/javascript" )
34
36
app . importmap . cache_sweeper ( watches : app . config . importmap . cache_sweepers )
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def digest(resolver:)
69
69
Digest ::SHA1 . hexdigest ( to_json ( resolver : resolver ) . to_s )
70
70
end
71
71
72
- # Returns an instance ActiveSupport::EventedFileUpdateChecker configured to clear the cache of the map
72
+ # Returns an instance of ActiveSupport::EventedFileUpdateChecker configured to clear the cache of the map
73
73
# when the directories passed on initialization via `watches:` have changes. This is used in development
74
74
# and test to ensure the map caches are reset when javascript files are changed.
75
75
def cache_sweeper ( watches : nil )
You can’t perform that action at this time.
0 commit comments