]> source.dussan.org Git - jquery.git/commitdiff
Fix #13983. Switch to //# for sourcemap directives. (cherry-picked from dfaee326e6605...
authorMichał Gołębiowski <m.goleb@gmail.com>
Thu, 5 Sep 2013 16:24:13 +0000 (18:24 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Thu, 5 Sep 2013 16:24:13 +0000 (18:24 +0200)
Gruntfile.js
build/tasks/dist.js
build/tasks/uglify.js

index 8bd906b3f8601597c666455b55aa0c5f4c28460f..e62255720266cd694f5723e4704fd8d4ca0a6ffb 100644 (file)
@@ -83,12 +83,10 @@ module.exports = function( grunt ) {
                                        "dist/jquery.pre-min.js": [ "dist/jquery.js" ]
                                },
                                options: {
-                                       banner: "\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
+                                       banner: "\n\n\n\n\n\n\n\n\n\n\n\n" + // banner line size must be preserved
                                                "/*! jQuery v<%= pkg.version %> | " +
                                                "(c) 2005, 2013 jQuery Foundation, Inc. | " +
-                                               "jquery.org/license\n" +
-                                               "//@ sourceMappingURL=jquery.min.map\n" +
-                                               "*/\n"
+                                               "jquery.org/license */\n"
                                }
                        }
                },
index 591078cde7adb1541f70cb22351038810c3dd6dd..97d882e7097ebc975dbbb86dc4580b5bd72984fd 100644 (file)
@@ -57,18 +57,6 @@ module.exports = function( grunt ) {
                        if ( /\.map$/.test( filename ) ) {
                                text = text.replace( /"dist\//g, "\"" );
                                fs.writeFileSync( filename, text, "utf-8" );
-
-                       // Use our hard-coded sourceMap directive instead of the autogenerated one (#13274; #13776)
-                       } else if ( /\.min\.js$/.test( filename ) ) {
-                               i = 0;
-                               text = text.replace( /(?:\/\*|)\n?\/\/@\s*sourceMappingURL=.*(\n\*\/|)/g,
-                                       function( match ) {
-                                               if ( i++ ) {
-                                                       return "";
-                                               }
-                                               return match;
-                                       });
-                               fs.writeFileSync( filename, text, "utf-8" );
                        }
 
                        // Optionally copy dist files to other locations
index 7c1a01beccb65953905e614ea945b9d381330b07..ccbc708884bad45f7566278ae1ad8724903987c5 100644 (file)
@@ -38,12 +38,8 @@ module.exports = function( grunt ) {
                        // Rename the file to a temporary name.
                        fs.renameSync( mapFileName, mapping.dest);
                        grunt.file.write( mapFileName, grunt.file.read( mapping.dest )
-                               // The uglify task erroneously prepends dist/ to file names.
-                               .replace( /"dist\//g, "\"" )
                                // Refer to the source jquery.js, not the temporary jquery.pre-min.js.
-                               .replace( /\.pre-min\./g, "." )
-                               // There's already a pragma at the beginning of the file, remove the one at the end.
-                               .replace( /\/\/@ sourceMappingURL=jquery\.min\.map$/g, "" ));
+                               .replace( /\.pre-min\./g, "." ));
                });
 
                // Remove temporary files.