diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index a4130cff60a6..53ea134f0699 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,3 +1,5 @@ +// TypeScript config that is used to build the e2e spec files. Protractor will use TS-Node to +// compile the e2e/ folder at runtime. { "compilerOptions": { "declaration": true, diff --git a/src/demo-app/tsconfig-aot.json b/src/demo-app/tsconfig-aot.json index c2ad1d498dc4..eadf8e0b2520 100644 --- a/src/demo-app/tsconfig-aot.json +++ b/src/demo-app/tsconfig-aot.json @@ -1,6 +1,8 @@ -/* Config file for the Angular Compiler. Paths need to be relative to the dist folder. */ +// TypeScript config that extends the demo-app tsconfig file. This config compiles the +// "main-aot.ts" file and also enables templage code generation / AOT. All paths need +// to be relative to the output directory. { - "extends": "./tsconfig", + "extends": "./tsconfig-build", "compilerOptions": { "experimentalDecorators": true, "paths": { diff --git a/src/demo-app/tsconfig.json b/src/demo-app/tsconfig-build.json similarity index 82% rename from src/demo-app/tsconfig.json rename to src/demo-app/tsconfig-build.json index 7b70b0212017..224f8b102c13 100644 --- a/src/demo-app/tsconfig.json +++ b/src/demo-app/tsconfig-build.json @@ -1,3 +1,5 @@ +// TypeScript config file that is used to compile the demo-app. Target environment will be ES5, +// since the demo-app will be served in the browser. { "compilerOptions": { "declaration": false, diff --git a/src/e2e-app/tsconfig.json b/src/e2e-app/tsconfig-build.json similarity index 79% rename from src/e2e-app/tsconfig.json rename to src/e2e-app/tsconfig-build.json index 637f489bd75e..b640a7213c83 100644 --- a/src/e2e-app/tsconfig.json +++ b/src/e2e-app/tsconfig-build.json @@ -1,3 +1,5 @@ +// TypeScript config file that is used to compile the e2e-app. Protractor will run all specs +// against the e2e-app in the browser and therefore the code needs to be ES5 compatible. { "compilerOptions": { "declaration": true, diff --git a/src/lib/tsconfig.json b/src/lib/tsconfig-build.json similarity index 80% rename from src/lib/tsconfig.json rename to src/lib/tsconfig-build.json index 67ebfc7d9f85..4819e3972621 100644 --- a/src/lib/tsconfig.json +++ b/src/lib/tsconfig-build.json @@ -1,3 +1,5 @@ +// TypeScript config file that is used to compile the library. Target environment needs to be +// ES2015 since the build process will create FESM bundles using rollup. { "compilerOptions": { "baseUrl": ".", diff --git a/src/lib/tsconfig-specs.json b/src/lib/tsconfig-specs.json index c0bfeb60ea43..c84a07778eaf 100644 --- a/src/lib/tsconfig-specs.json +++ b/src/lib/tsconfig-specs.json @@ -1,5 +1,8 @@ +// TypeScript config file that extends the default tsconfig file for the library. This config is +// used to compile the specs for Karma. Since the code will run inside of the browser, the target +// needs to be ES5. The format needs to be CommonJS since Karma only supports that module format. { - "extends": "./tsconfig", + "extends": "./tsconfig-build", "compilerOptions": { "module": "commonjs", "target": "es5", diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 000000000000..9f199f2cf4a7 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,15 @@ +// TypeScript config file that matches all source files in the project. This file is read by +// IDEs and ensures that `experimentalDecorator` warnings are not showing up. +{ + "compilerOptions": { + "experimentalDecorators": true, + "module": "es2015", + "moduleResolution": "node", + "outDir": "../../dist/packages/all", + "sourceMap": true, + "inlineSources": true, + "target": "es2015", + "lib": ["es2015", "dom"], + "types": ["jasmine"] + } +} diff --git a/tools/gulp/tasks/development.ts b/tools/gulp/tasks/development.ts index fc4636f1a6f1..316905617bfc 100644 --- a/tools/gulp/tasks/development.ts +++ b/tools/gulp/tasks/development.ts @@ -16,7 +16,7 @@ task(':watch:devapp', () => { }); /** Path to the demo-app tsconfig file. */ -const tsconfigPath = join(appDir, 'tsconfig.json'); +const tsconfigPath = join(appDir, 'tsconfig-build.json'); task(':build:devapp:ts', tsBuildTask(tsconfigPath)); task(':build:devapp:scss', sassBuildTask(outDir, appDir)); diff --git a/tools/gulp/tasks/e2e.ts b/tools/gulp/tasks/e2e.ts index f84859244dd2..ea94fad90712 100644 --- a/tools/gulp/tasks/e2e.ts +++ b/tools/gulp/tasks/e2e.ts @@ -13,7 +13,7 @@ const appDir = path.join(SOURCE_ROOT, 'e2e-app'); const outDir = DIST_E2EAPP; const PROTRACTOR_CONFIG_PATH = path.join(PROJECT_ROOT, 'test/protractor.conf.js'); -const tsconfigPath = path.join(appDir, 'tsconfig.json'); +const tsconfigPath = path.join(appDir, 'tsconfig-build.json'); task(':watch:e2eapp', () => { watch(path.join(appDir, '**/*.ts'), [':build:e2eapp:ts']); diff --git a/tools/gulp/tasks/library.ts b/tools/gulp/tasks/library.ts index 2de4da5c29d4..e46f8d4d9e53 100644 --- a/tools/gulp/tasks/library.ts +++ b/tools/gulp/tasks/library.ts @@ -13,7 +13,7 @@ const inlineResources = require('../../../scripts/release/inline-resources'); const uglify = require('uglify-js'); const libraryRoot = join(SOURCE_ROOT, 'lib'); -const tsconfigPath = join(libraryRoot, 'tsconfig.json'); +const tsconfigPath = join(libraryRoot, 'tsconfig-build.json'); // Paths to the different output directories. const materialDir = DIST_MATERIAL; diff --git a/tools/gulp/tsconfig.json b/tools/gulp/tsconfig.json index 50414a019e52..ab9b9a6c6023 100644 --- a/tools/gulp/tsconfig.json +++ b/tools/gulp/tsconfig.json @@ -1,3 +1,5 @@ +// TypeScript config file that will be used to compile the gulp tasks. The normal gulpfile will +// use TS-Node to compile the gulp tasks at runtime. { "compilerOptions": { "experimentalDecorators": true,