don't preload sourcemaps

closes CFA-48

Change-Id: I38818cd14e681188663e74251658788054d1158e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339163
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
Aaron Shafovaloff 2024-01-29 14:23:38 -07:00
parent 8b7d2c4925
commit 6f9a13e0c8
2 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,8 @@ module Canvas
end
def entries
@manifest.values.grep(/-entry-\w+\.js/).map { |file_path| realpath(file_path) }
# contains -entry- in filename, ends in .js, but doesn't end in .map.js
@manifest.values.grep(/-entry-\w+(?<!\.map)\.js/).map { |file_path| realpath(file_path) }
end
private

View File

@ -104,5 +104,15 @@ describe Canvas::Cdn::Registry do
]
)
end
it "does not include .map.js files" do
@webpack_manifest = { "main" => "a-entry-1234.js", "foo" => "a-entry-1234.map.js" }
expect(subject.entries).to eq(
[
"/dist/webpack-dev/a-entry-1234.js"
]
)
end
end
end