DEV: Use absolute path for popper.js sourcemap (#11762)
This commit is contained in:
parent
7f7bae1262
commit
a9dfc5a547
|
@ -314,6 +314,16 @@ task 'javascript:update' => 'clean_up' do
|
|||
else
|
||||
FileUtils.cp_r(src, dest)
|
||||
end
|
||||
|
||||
# use absolute path for popper.js's sourcemap
|
||||
# avoids noisy console warnings in dev environment for non-homepage paths
|
||||
if dest.end_with? "popper.js"
|
||||
File.open(dest) do |file|
|
||||
contents = file.read
|
||||
contents.gsub!("sourceMappingURL=popper", "sourceMappingURL=/popper")
|
||||
File.open(dest, "w+") { |d| d.write(contents) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
write_template("discourse/app/lib/public-js-versions.js", "update", <<~JS)
|
||||
|
|
|
@ -1731,4 +1731,4 @@
|
|||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=popper.js.map
|
||||
//# sourceMappingURL=/popper.js.map
|
||||
|
|
Loading…
Reference in New Issue