Coder Social home page Coder Social logo

vscode-ts-debug's Introduction

在 VSCode 下使用 TypeScript 愉快刷题

VSCode 下的 TypeScript 断点调试方法,附带个人 OJ 题库题解:

  • 剑指 Offer
  • leetcode 题库前 200
  • TypeChallenge 题库部分题目

食用方法

安装环境

使用 git clone 将本仓库克隆到本地,或者下载当前包.

  1. 全局安装 typescripttsc

    npm install typescript tsc -g
  2. cd 到该目录,并执行命令行 npm install

调试

支持在 VSCode 的 “调试” 面板、以及命令行内,来进行 TS 程序调试。

在 VSCode 中

点击进入 VSCode 的 “调试” 面板,可在顶部选择框中看到,本项目提供的两种不同的打包调试方式。

  • Launch Program:将与当前文件相关联的所有 TS 文件,编译到 dist 目录,并执行当前文件。

    (相关联指包含使用 import 方法等导入的其他关联文件)

  • Launch Program (Build the Project):编译 src 目录下的所有 TS 文件dist 目录,并执行当前文件。

命令行中

通过命令行来进行热更新调试操作。

  • npm run dev:使用 ts-node 执行 /src/index.ts 文件,

    随着 src 目录文件发生变化进行热更新

打包 & 其他命令

  • npm run build:使用 tsc 编译所有 src 目录下的 TS 文件到 dist 目录
  • npm run start:执行 dist/index.js
  • npm run clear:清空 dist 目录

vscode-ts-debug's People

Contributors

bobbyjonas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.