我有使用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
如果我走了,並沒有實現我的目標更有效的方式,我希望這條道路也是如此。感謝您的任何提示!