This project demonstrates a skeleton structure and necessary settings files to allow TypeScript development in Visual Studio Code (as of build 0.7.10). The project builds all TypeScript (.ts
) files into a build/js
directory in the root.
- You need Node.js. Go install it
- Ensure the required dependencies have been installed:
$ npm install
- Clone the repository
- Open VSCode and select the root of the cloned repository as the project folder
- Build by either:
- Hitting CTRL/Cmd+Shift+B to build, which is declared in the
.settings/tasks.json
file with theisBuildCommand
marker - Press CTRL/Cmd+Shift+P and select the
Tasks: Run Build Task
option - Press CTRL/Cmd+Shift+P, delete the
>
and typetask build
- If there were no errors, you should see a new directory,
build
, in the root with the following content:
build/
lib/
mymodule.js
mymodule.js.map
test/
app.test.js
app.test.js.map
app.js
app.js.map
Your .ts
files have been compiled to .js
files within the build
directory, and each should have a .js.map
sourcemap file alongside it to allow stack traces to correctly report the line in the original file. See this StackOverflow article for an overview of what a sourcemap is.
There's a sample test located in the test
folder. You can run them by hitting CTRL/Command+Shift+T (or use the Tasks
menu and run Tasks: Run Test Task
)
To run the project in debug mode, simply hit F5! Place breakpoints in your TypeScript code and view them in the debugger (CTRL+Shift+D or Cmd+Shift+D).
MIT