New TypeScript project

To start a new TypeScript project in Visual Studio, follow these quick steps:

  1. Open Visual Studio
  2. Create a new “Blank TypeScript Project”
  3. Include CRM Types in your project, execute in VS terminal: “npm install @types/xrm –save-dev”
  4. Add a new item to your VS project, “example-name.ts” file.
  5. Now let’s code!

Visual Studio Terminal tips

StatementDescription
npm initCreate a “package.json” file, used for configuration.
npm install -g typescriptGlobally add TypeScript packages.
npm install typescript –save-devSame as previous statement, but only in current folder.
npm install @types/node –save-devInstall node types.
npm install @types/xrm –save-devInstall CRM types.
tsc –initCreate a “tsconfig.json” file, configure the transpiler.

Deploy the project

Right mouse click a TypeScript file and select “add link…”.