vscode + angular

0、在命令行中,cd到项目下执行:javascript

npm install

一、调试-》启动调试-》node.js, 会生成.vscode/launch.json文件java

二、修改launch.json文件"program": "${workspaceRoot}/node_modules/lite-server/bin/lite-server"node

三、任务:配置任务运行程序-》建立Typescript项目,生成tasks.jsontypescript

四、Ctrl+Shift+B 运行,会报错,须要.vscode目录下增长settings.json文件:npm

// 将设置放入此文件中以覆盖默认值和用户设置。
{
    "typescript.tsdk": "node_modules/typescript/lib",

    // ts 项目, 隐藏 .js 和 .js.map 文件
    "files.exclude": {
        "node_modules": true,
        "**/*.js": { "when": "$(basename).ts" },
        "**/*.js.map": true
    }

}

  修改tasks.json文件:json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "cmd",
    "isShellCommand": true,
    "showOutput": "always",
    "args": ["/C npm start"]
}

 六、Ctrl+Shift+B 运行Ok,弹窗自动访问http://localhost:3000/bash

相关文章
相关标签/搜索