Skip to content

Commit

Permalink
Use //# instead of //@ for sourceMappingURL comment
Browse files Browse the repository at this point in the history
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 facebook#4892

Reviewed By: martinbigio

Differential Revision: D2781046

Pulled By: davidaurelio

fb-gh-sync-id: 3b85f6153692a2e23509029ecf18dc51d35ba921
  • Loading branch information
janicduplessis authored and facebook-github-bot-6 committed Dec 23, 2015
1 parent d1e5fb8 commit 3872e5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packager/react-packager/src/Bundler/Bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions packager/react-packager/src/Bundler/__tests__/Bundle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});

Expand Down Expand Up @@ -90,7 +90,7 @@ describe('Bundle', function() {
'transformed bar;',
';require("bar");',
';require("foo");',
'\/\/@ sourceMappingURL=test_url',
'\/\/# sourceMappingURL=test_url',
].join('\n'));
});

Expand Down

0 comments on commit 3872e5f

Please sign in to comment.