mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
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") }
|
||||
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?
|
||||
self.request_cached_script_chunks = chunk_infos
|
||||
rescue Errno::ENOENT
|
||||
|
@ -57,7 +63,7 @@ class EmberCli < ActiveSupport::CurrentAttributes
|
|||
end
|
||||
|
||||
def self.clear_cache!
|
||||
@prod_chunk_infos = nil
|
||||
@production_chunk_infos = nil
|
||||
@assets = nil
|
||||
self.request_cached_script_chunks = nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user