Skip to content

Commit 34700c2

Browse files
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.
1 parent b4b8f0a commit 34700c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/debug-adapter/nativeScriptDebugAdapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
186186
args.sourceMapPathOverrides['webpack:///*'] = `${fullAppDirPath}/*`;
187187
}
188188

189-
const webpackConfigFile = join(`./${args.webRoot}`, 'webpack.config.js');
189+
const webpackConfigFile = join(args.webRoot, 'webpack.config.js');
190190

191191
if (existsSync(webpackConfigFile)) {
192192
try {

0 commit comments

Comments
 (0)