add //#sourceUrl comment so that debugging worker extensions becomes easier

This commit is contained in:
Johannes Rieken 2020-05-13 18:18:28 +02:00
parent dc950c0080
commit 691e13b5b5

View file

@ -50,7 +50,8 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
}
// fetch JS sources as text and create a new function around it
const initFn = new Function('module', 'exports', 'require', 'window', await response.text());
const source = await response.text();
const initFn = new Function('module', 'exports', 'require', 'window', `${source}\n//# sourceURL=${module.toString(true)}`);
// define commonjs globals: `module`, `exports`, and `require`
const _exports = {};