mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Ensure service-worker sourcemap URLs do not duplicate extension (#16704)
`script_asset_path('.../blah.js.map')` was appending `.js`, which would result in a filename like `.js.map.js`. It would also lose the `/assets` prefix, since the map files are not included in the sprockets manifest.
This commit updates the sourceMappingURL rewriting logic to calculate the service-worker's own JS url, and then append `.map`.
This commit is contained in:
@@ -420,7 +420,7 @@ describe StaticController do
|
||||
get "/service-worker.js"
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.content_type).to start_with("application/javascript")
|
||||
expect(response.body).to include("sourceMappingURL=/assets/service-worker-abcde.js.map")
|
||||
expect(response.body).to include("sourceMappingURL=/assets/service-worker.js.map\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user