Add support for sourcemaps with uglify2

Fixes #18341.

(cherry picked from commit 51a1844ee3cedfc669a3ad70e1894e2e5e3e781d)