Skip to content

Commit 25e0059

Browse files
committed
Fixes microsoft#103027: Add a marker to the sourceURL of web extensions
1 parent be901d8 commit 25e0059

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/vs/workbench/api/worker/extHostExtensionService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
5151

5252
// fetch JS sources as text and create a new function around it
5353
const source = await response.text();
54-
const initFn = new Function('module', 'exports', 'require', `${source}\n//# sourceURL=${module.toString(true)}`);
54+
// Here we append #vscode-extension to serve as a marker, such that source maps
55+
// can be adjusted for the extra wrapping function.
56+
const sourceURL = `${module.toString(true)}#vscode-extension`;
57+
const initFn = new Function('module', 'exports', 'require', `${source}\n//# sourceURL=${sourceURL}`);
5558

5659
// define commonjs globals: `module`, `exports`, and `require`
5760
const _exports = {};

0 commit comments

Comments
 (0)