vscode + angular

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 04:09:17

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

npm install

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

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

3、任务:配置任务运行程序-》创建Typescript项目,生成tasks.json

4、Ctrl+Shift+B 运行,会报错,需要.vscode目录下增加settings.json文件:

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

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

}

  修改tasks.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"]
}

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

 

转载于:https://www.cnblogs.com/ivan0626/p/6682614.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!