Skip to content

Commit

Permalink
fix: split sourceMap string to avoid false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jul 5, 2023
1 parent b10d614 commit 6dd289c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ function addHook(extension, options) {
filePath,
},
);
const suffix = `//# sourceMappingURL=data:application/json,${encodeURIComponent(
// Split the source map comment across two strings so that tools like
// source-map-support don't accidentally interpret it as a source map
// comment for this file.
const sourceMappingURL = 'sourceMappingURL';
const suffix = `//# ${sourceMappingURL}=data:application/json,${encodeURIComponent(
JSON.stringify(sourceMap),
)}`;
return `${transformedCode}\n${suffix}`;
Expand Down

0 comments on commit 6dd289c

Please sign in to comment.