From 61c745b8e6a54fb31ec1c5f96d781c85f5636dad Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Wed, 23 Dec 2015 11:38:02 -0800 Subject: [PATCH] Use //# instead of //@ for sourceMappingURL comment Summary: I had an issue debugging in chrome 48 on windows where source maps didn't work. I tried changing the sourceMappingURL comment to use the //# syntax instead and it fixed the problem. According to https://developers.google.com/web/updates/2013/06/sourceMappingURL-and-sourceURL-syntax-changed?hl=en the //@ syntax was deprecated for //#. Closes https://github.com/facebook/react-native/pull/4892 Reviewed By: martinbigio Differential Revision: D2781046 Pulled By: davidaurelio fb-gh-sync-id: 3b85f6153692a2e23509029ecf18dc51d35ba921 --- react-packager/src/Bundler/Bundle.js | 2 +- react-packager/src/Bundler/__tests__/Bundle-test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/react-packager/src/Bundler/Bundle.js b/react-packager/src/Bundler/Bundle.js index 007dca29..11a892f7 100644 --- a/react-packager/src/Bundler/Bundle.js +++ b/react-packager/src/Bundler/Bundle.js @@ -14,7 +14,7 @@ const UglifyJS = require('uglify-js'); const ModuleTransport = require('../lib/ModuleTransport'); const Activity = require('../Activity'); -const SOURCEMAPPING_URL = '\n\/\/@ sourceMappingURL='; +const SOURCEMAPPING_URL = '\n\/\/# sourceMappingURL='; const minifyCode = code => UglifyJS.minify(code, {fromString: true, ascii_only: true}).code; diff --git a/react-packager/src/Bundler/__tests__/Bundle-test.js b/react-packager/src/Bundler/__tests__/Bundle-test.js index 46b57741..6dd3d3b7 100644 --- a/react-packager/src/Bundler/__tests__/Bundle-test.js +++ b/react-packager/src/Bundler/__tests__/Bundle-test.js @@ -43,7 +43,7 @@ describe('Bundle', function() { expect(bundle.getSource({dev: true})).toBe([ 'transformed foo;', 'transformed bar;', - '\/\/@ sourceMappingURL=test_url' + '\/\/# sourceMappingURL=test_url' ].join('\n')); }); @@ -90,7 +90,7 @@ describe('Bundle', function() { 'transformed bar;', ';require("bar");', ';require("foo");', - '\/\/@ sourceMappingURL=test_url', + '\/\/# sourceMappingURL=test_url', ].join('\n')); });