In the midst of working on a project in TypeScript, I encountered a dilemma involving two developers using different operating systems - one on Windows and the other on Mac OS. The issue at hand is the conflicting directory slashes (\ for Windows and / for Mac OS). Within my launch.json file located in the .vscode directory, the configuration appears as follows:
{
"version": "0.2.0",
"configurations": [
{
"program": "${workspaceRoot}/src/main.ts",
"cwd": "${workspaceRoot}/tests/reference"
}
]
}
To tackle this problem, I attempted the following approach:
{
"version": "0.2.0",
"osx" : {
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/main.ts",
"cwd": "${workspaceRoot}/tests/reference"
}
]
},
"windows" : {
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}\\src\\main.ts",
"cwd": "${workspaceRoot}\\tests\\reference"
}
]
}
}
However, the compiler raised an error stating that the configuration was non-existent, leading me to conclude that my initial attempt was not viable.