FIX: Correctly map fingerprinted vendor.js file in production (#24267)
Followup to a0b94dca16
This commit is contained in:
parent
039d060832
commit
0889f22a3b
|
@ -24,6 +24,12 @@ class EmberCli < ActiveSupport::CurrentAttributes
|
||||||
value["assets"].map { |chunk| chunk.delete_prefix("assets/").delete_suffix(".js") }
|
value["assets"].map { |chunk| chunk.delete_prefix("assets/").delete_suffix(".js") }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Special case - vendor.js is fingerprinted by Embroider in production, but not run through Webpack
|
||||||
|
if !assets.include?("vendor.js") &&
|
||||||
|
fingerprinted = assets.find { |a| a.match?(/^vendor\..*\.js$/) }
|
||||||
|
chunk_infos["vendor"] = [fingerprinted.delete_suffix(".js")]
|
||||||
|
end
|
||||||
|
|
||||||
@production_chunk_infos = chunk_infos if Rails.env.production?
|
@production_chunk_infos = chunk_infos if Rails.env.production?
|
||||||
self.request_cached_script_chunks = chunk_infos
|
self.request_cached_script_chunks = chunk_infos
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
|
@ -57,7 +63,7 @@ class EmberCli < ActiveSupport::CurrentAttributes
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.clear_cache!
|
def self.clear_cache!
|
||||||
@prod_chunk_infos = nil
|
@production_chunk_infos = nil
|
||||||
@assets = nil
|
@assets = nil
|
||||||
self.request_cached_script_chunks = nil
|
self.request_cached_script_chunks = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue