[VS CODE].vscode資料夾用處

.vscode資料夾用處

settings.json 用來做一些資料夾顯示 或不顯示

{
    "editor.insertSpaces": true,
    "files.trimTrailingWhitespace": true,
    "files.exclude": {
        ".git": false,
        "bin": true,
        "node_modules": false
    },
    "search.exclude": {
        ".git": false,
        "node_modules": true,
        "bin": true,
        "out": true
    }
}

launch.json  debug時的參數設定,例如:起始頁面,用什麼瀏覽器運行

{
    "version": "0.1.0",
    "configurations":
    [
        {
            "name": "test chrome",
            "type": "chrome",
            "request": "launch",
            //Debug的起始頁面位址
            "url": "http://localhost:8080/dist/index.html",
            //是否參考SourceMap來Debug
            "sourceMaps": true,
            //Log是否要寫
            "diagnosticLogging": true,
            //當在Debug的時候,此位置為默認的hosting位置。與上面的url
            //及sourcemap的相對路徑友直接關係喔
            "webRoot": "",
            "runtimeArgs":
            [
                //每次運行都開啟新視窗
                "--new-window",
                //指定根目錄路徑,index.html所在路徑
                "--user-data-dir=D:/CodeByWork/Git/angular2typescriptsampleapp/dist/",
                //Open in port 9222 (standard chrome debug port)
                "--remote-debugging-port=9222"
             ]
        }
    ]
}

task.json 可設定build檔案的參數,如可使用gulpfile或是tsc方式build檔案

{
    "version": "0.1.0",
    "command": "gulp",
    "isShellCommand": true,
    "tasks": [
       {
            //taskName會匹配到gulp task name
            "taskName": "default",
            "args": ["-w"],
            "isBuildCommand": true,
            "isWatching": true,
            "problemMatcher": [
                "$tsc"
            ]
        }

    ]
}