]> source.dussan.org Git - jquery.git/commitdiff
Fix #12886. Fix map file reference in .min.js file.
authorDave Methvin <dave.methvin@gmail.com>
Thu, 10 Jan 2013 15:35:50 +0000 (10:35 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Thu, 10 Jan 2013 15:50:25 +0000 (10:50 -0500)
Cherry picked from e348b4060848b46a6c4376661c093e0f0a3ef9e7 .

Gruntfile.js

index eb56098d4b162bc6891fab0b1ff30161f2f53d75..f18d071a0093f979c173d8ed19963a694496605f 100644 (file)
@@ -432,11 +432,14 @@ module.exports = function( grunt ) {
                                nonascii = true;
                        }
 
-                       // Modify map so that it points to files in the same folder;
+                       // Modify map/min so that it points to files in the same folder;
                        // see https://github.com/mishoo/UglifyJS2/issues/47
                        if ( /\.map$/.test( filename ) ) {
                                text = text.replace( /"dist\//g, "\"" );
                                fs.writeFileSync( filename, text, "utf-8" );
+                       } else if ( /\.min\.js$/.test( filename ) ) {
+                               text = text.replace( /sourceMappingURL=dist\//, "sourceMappingURL=" );
+                               fs.writeFileSync( filename, text, "utf-8" );
                        }
 
                        // Optionally copy dist files to other locations