diff --git a/build/minify.js b/build/minify.js index 81e198163..e32d9eb5b 100755 --- a/build/minify.js +++ b/build/minify.js @@ -445,7 +445,7 @@ if (isMapped) { var mapOutput = fs.readFileSync(mapPath, 'utf8'); fs.unlinkSync(mapPath); - output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/'; + output = output.replace(/[\s;]*$/, '\n//# sourceMappingURL=' + sourceMapURL); mapOutput = JSON.parse(mapOutput); mapOutput.file = path.basename(outputPath); diff --git a/lodash.js b/lodash.js index 349f8b956..e57917701 100644 --- a/lodash.js +++ b/lodash.js @@ -5521,7 +5521,7 @@ // avoid issues with Narwhal, IE conditional compilation, and the JS engine // embedded in Adobe products. // http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - var sourceURL = '\n/*\n//@ sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\n*/'; + var sourceURL = '\n/*\n//# sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\n*/'; try { var result = Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues); diff --git a/test/test-build.js b/test/test-build.js index 17197bbdd..914dd2396 100644 --- a/test/test-build.js +++ b/test/test-build.js @@ -819,12 +819,11 @@ asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() { var callback = _.once(function(data) { var basename = path.basename(data.outputPath, '.js'), - comment = (/(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)$/.exec(data.source) || [])[0], sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'], sourceMap = JSON.parse(data.sourceMap), sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0]; - ok(RegExp('/\\*\\n//@ sourceMappingURL=' + sourceMapURL + '.map\\n\\*/').test(comment), basename); + ok(RegExp('\\n//# sourceMappingURL=' + sourceMapURL + '.map$').test(data.source), basename); equal(sourceMap.file, basename + '.js', basename); deepEqual(sourceMap.sources, sources, basename);