]> source.dussan.org Git - jquery.git/commitdiff
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:35:50 +0000 (10:35 -0500)
Gruntfile.js

index 0c2c8bb93b615dd52bae5b5b3c01e97191670f10..11c5c300a1aff58515a393d32dff80015ca598e3 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