Skip to content

TypeScript BuildPath

angelozerr edited this page Apr 29, 2016 · 13 revisions

TypeScript Build Path

TypeScript nature

In a lot of Eclipse plugins (JDT, JSDT, other TypeScript plugins), they use Eclipse Nature which is used to for instance showing some menus according the nature of the Eclipse project.

TypeScript IDE doesn't use Eclipse Nature because a TypeScript project can be created with other IDE like VSCode, Atom, WebStorm, etc.

For TypeScript IDE, an Eclipse project is a TypeScript project if it contains one or more tsconfig.json files. The problem is that tsconfig.json files can be hosted in any folders of the project. To avoid scanning each time the whole of files of project each time, TypeScript IDE uses the following rules:

  • search tsconfig.json inside root project and /src folder. If a tsconfig.json file exists in this location, the project has TypeScript Nature.

TODO : manage that with UI preferences to add other default folder.

  • if tsconfig.json is not found in the default location, you can add one or several folders of your project by using TypeScript Build Path.

When a project has TypeScript Nature:

  • it display TypeScript Resources in the root of project inside the Project Explorer:

TypeScript Nature Inside Project Explorer

  • the TypeScript menu item of the project properties is shown:

TypeScript Nature Inside Project Properties

What is Build Path?

TypeScript Build Path is a list of folders which contains a tsconfig.json' file in the root folder. Build Path` is used for:

  • Know if the Eclipse project is a TypeScript project. (No nature, TypeScript menu).
  • Compilation
  • Validation

TypeScript Nature

Compilation

Validation