Set up the build

Set up the build

Right click on the project and click New Item. Then choose TypeScript Configuration File and use the default name tsconfig.json.

Create tsconfig.json

Replace the default tsconfig.json with the following:

{
  "compilerOptions": {
  "noImplicitAny": true,
  "noEmitOnError": true,
  "sourceMap": true,
  "target": "es5",
  "outDir": "./Scripts/App"
  },
  "files": [
  "./src/app.ts",
  ],
  "compileOnSave": true
}

This is similar to the default, with the following differences:

  1. It sets "noImplicitAny": true.
  2. It specifies that "outDir": "./Scripts/App".
  3. It explicitly lists "files" instead of relying on "excludes".
  4. It sets "compileOnSave": true.

"noImplicitAny" is good idea whenever you’re writing new code — you can make sure that you don’t write any untyped code by mistake. "compileOnSave" makes it easy to update your code in a running web app. See the tsconfig.json documentation for more information.

doc_TypeScript
2016-10-04 19:25:34
Comments
Leave a Comment

Please login to continue.