markdown VSCode中的Typescript设置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown VSCode中的Typescript设置相关的知识,希望对你有一定的参考价值。

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "sourceMap": true
    },
    "exclude": [
        "node_modules"
    ]
}
class Startup {
    public static main(): number {
        console.log('Hello World');
        return 0;
    }
}

Startup.main();
# Jay's Typescript Setup Notes

## In Terminal

Add typescript globally to to my computer
```
npm install -g typescript
```

Check to make sure it worked
```
tsc --version
tsc --help
```

## Setup a simple example

First create a simple config file to build from the typescript files
- see attached tsconfig.json

Create helloworld file in typescript
- see attached helloworld.ts

Build in VSCode with tsconfig.json
- see that it produced a helloworld.js file
- see that it produced a helloworld.js.map file

## Run in terminal to make sure it spits out 'Hello World'
type this in
```
node helloworld.js
```

### Voila!

以上是关于markdown VSCode中的Typescript设置的主要内容,如果未能解决你的问题,请参考以下文章

VScode搭建TypeScript开发环境

【工具】VSCode 中的MD编辑插件Markdown Preview Enhanced

vscode中预览markdown文件

markdown [vscode配置笔记]#学习笔记#vscode应用

在VSCode中使用Markdown

markdown [vscode快捷键]#学习笔记#vscode应用