diff --git a/src/chromeDebugAdapter.ts b/src/chromeDebugAdapter.ts index b8c41e3f..41d60dee 100644 --- a/src/chromeDebugAdapter.ts +++ b/src/chromeDebugAdapter.ts @@ -187,9 +187,9 @@ export class ChromeDebugAdapter extends CoreDebugAdapter { } public commonArgs(args: ICommonRequestArgs): void { - if (!args.webRoot && args.pathMapping && args.pathMapping['/']) { - // Adapt pathMapping['/'] as the webRoot when not set, since webRoot is explicitly used in many places - args.webRoot = args.pathMapping['/']; + if (args.webRoot && (!args.pathMapping || !args.pathMapping['/'])) { + args.pathMapping = args.pathMapping || {}; + args.pathMapping['/'] = args.webRoot; } args.sourceMaps = typeof args.sourceMaps === 'undefined' || args.sourceMaps; diff --git a/src/chromeDebugInterfaces.d.ts b/src/chromeDebugInterfaces.d.ts index d98e0fd5..3ed17a90 100644 --- a/src/chromeDebugInterfaces.d.ts +++ b/src/chromeDebugInterfaces.d.ts @@ -6,6 +6,7 @@ import * as Core from 'vscode-chrome-debug-core'; import { DebugProtocol } from 'vscode-debugprotocol'; export interface ICommonRequestArgs extends Core.ICommonRequestArgs { + webRoot?: string; disableNetworkCache?: boolean; urlFilter?: string; } diff --git a/testapp/.vscode/settings.json b/testapp/.vscode/settings.json index a9fed253..f1719615 100644 --- a/testapp/.vscode/settings.json +++ b/testapp/.vscode/settings.json @@ -10,5 +10,7 @@ "node_modules": true, "bin": true, "out": true - } + }, + + "tslint.enable": false } \ No newline at end of file