Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ensure Ember CLI sourcemaps are uploaded to S3 (#15893)

David Taylor51b88c0e2c53
diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake
index 2c54f9f6a49..b8aa43eee4f 100644
--- a/lib/tasks/s3.rake
+++ b/lib/tasks/s3.rake
@@ -59,9 +59,9 @@ def assets
fullpath = (Rails.root + "public/assets/#{path}").to_s
# Ignore files we can't find the mime type of, like yarn.lock
- if mime = MiniMime.lookup_by_filename(fullpath)
- content_type = mime.content_type
-
+ content_type = MiniMime.lookup_by_filename(fullpath)&.content_type
+ content_type ||= "application/json" if fullpath.end_with?(".map")
+ if content_type
asset_path = "assets/#{path}"
results << [fullpath, asset_path, content_type]