nativescript-community / nativescript-vscode-extension

A Visual Studio Code Extension for NativeScript
https://www.nativescript.org/visual-studio-code
Apache License 2.0
82 stars 32 forks source link

fix: debugging apps with library set should work on all platforms #265

Closed rosen-vladimirov closed 4 years ago

rosen-vladimirov commented 4 years ago

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'