From 34700c2864ae3be07b29d8bbdb1760b0b4df2e52 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 13 Sep 2019 15:18:57 +0300 Subject: [PATCH 1/2] fix: debugging apps with library set should work on all platforms Currently when you set library in your webpack.config.js, you are able to debug your app on windows, but not on macOS and Linux. The problem is in the way `path.join` works for UNIX style paths. The current code appends `./` in the beginning of the path, which is normally a full path: ``` path.join(`.//Users/vladimirov/Work/nativescript-cli-2/scratch/app1`, "test1.js") 'Users/vladimirov/Work/nativescript-cli-2/scratch/app1/test1.js' ``` As you can see, this removes the starting `/` from the full path, so the VSCode extension is unabel to get correct path to the searched file (webpack.config.js in our case). On windows the result is: ``` > path.join("./D:\\Work\\nativescript-cli\\scratch\\app1", "test1.js") 'D:\\Work\\nativescript-cli\\scratch\\app1\\test1.js' ``` Fix this by removing the `./` from the beginning - it was added there by mistake. --- src/debug-adapter/nativeScriptDebugAdapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug-adapter/nativeScriptDebugAdapter.ts b/src/debug-adapter/nativeScriptDebugAdapter.ts index 3347986..e1ed5d7 100644 --- a/src/debug-adapter/nativeScriptDebugAdapter.ts +++ b/src/debug-adapter/nativeScriptDebugAdapter.ts @@ -186,7 +186,7 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter { args.sourceMapPathOverrides['webpack:///*'] = `${fullAppDirPath}/*`; } - const webpackConfigFile = join(`./${args.webRoot}`, 'webpack.config.js'); + const webpackConfigFile = join(args.webRoot, 'webpack.config.js'); if (existsSync(webpackConfigFile)) { try { From 986c068cb0d1c2578a3e37f06f2478efd520b510 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 13 Sep 2019 15:23:34 +0300 Subject: [PATCH 2/2] release: cut 0.10.2 release --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa2acdb..d0b7d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +0.10.2 +==== +## Bug Fixes + - [Unable to debug applications when output.library in webpack.config.js is set](https://github.com/NativeScript/nativescript-vscode-extension/issues/263) + + 0.10.1 ==== ## Bug Fixes diff --git a/package.json b/package.json index 53f23b3..afae015 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "0.10.1", + "version": "0.10.2", "minNativescriptCliVersion": "2.5.0", "icon": "images/icon.png", "displayName": "NativeScript",