Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 854 Bytes

01.TypeScript 简介.md

File metadata and controls

49 lines (43 loc) · 854 Bytes

TypeScript 简介

安装

$ npm install -g typescript

新建项目

$ mkdir blog
$ cd blog
$ tsc --init
$ touch main.ts

开启 SourceMap

在 tsconfig.json 找到以下代码,取消注释。

"sourceMap": true,

观察模式编译 TS

$ tsc -w

launch.json

{
  // Use IntelliSense to learn about possible Node.js debug attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceRoot}/main.ts",
      "outFiles": [
        "${workspaceRoot}/*.js"
      ]
    }
  ]
}

参考链接