我有使用IIS 10去格式化这样一个位置,我的本地设置一个虚拟目录在Visual Studio代码显示虚拟目录路径...Visual Studio代码 - 而调试
http://vscode.dev/
,我可以看到我在我的index.htm页面上按下F5时,调试过程开始。我选择Chrome。然后我看到我在我的Chrome浏览器的网址去这样的事情...
file:///C:/Users/my-name/Documents/Visual%20Studio%202015/VS%20Projects/VSCode/sandbox/index.htm
这一切都被在Visual Studio代码生成从launch.json网页...
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch current file",
"type": "chrome",
"request": "launch",
//"file": "${workspaceRoot}/${file}"
"file" : "${file}"
},
{
"name": "Launch localhost with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost/mypage.html",
"sourceMaps": true,
"webRoot": "wwwroot"
},
{
"name": "Attach",
"type": "chrome",
"request": "attach",
"port": 9222
}
]
}
所以这里是我的问题....在这个页面中,我可以替换${file}
的部分路径,就像我们在JavaScript中使用replace()方法一样吗?像...
${file}.replace{'file:///C:/Users/my-name/Documents/Visual%20Studio%202015/VS%20Projects/VSCode/sandbox/':'http://vscode.dev/'}
...这种方式每当我调试我的.htm页面,它会去一个更干净的URL路径?像这样的....
http://vscode.dev/index.htm
如果我走了,并没有实现我的目标更有效的方式,我希望这条道路也是如此。感谢您的任何提示!