From 5ee16ad49ea6b3f93f84e0fd997479355b5bf840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 6 Jun 2019 16:44:56 +0200 Subject: [PATCH] feat(build): enable incremental compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miroslav Bajtoš --- .gitignore | 1 + packages/build/config/tsconfig.common.json | 2 ++ packages/cli/generators/project/templates/_.gitignore | 3 +++ packages/cli/generators/project/templates/tsconfig.json.ejs | 2 ++ packages/cli/test/integration/generators/app.integration.js | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index ff5c782b407f..a4ee80a6539a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ packages/tsdocs/fixtures/monorepo/docs /docs/site/readmes /docs/apidocs/reports-temp /docs/apidocs/models +*.tsbuildinfo # TBD: Exclude api reports from git for now /docs/apidocs/reports diff --git a/packages/build/config/tsconfig.common.json b/packages/build/config/tsconfig.common.json index 5aa85c2b0b3b..a3791d4ccf47 100644 --- a/packages/build/config/tsconfig.common.json +++ b/packages/build/config/tsconfig.common.json @@ -10,6 +10,8 @@ // FIXME(bajtos) LB4 is not compatible with this setting yet "strictPropertyInitialization": false, + "incremental": true, + "lib": ["es2018", "esnext.asynciterable"], "module": "commonjs", "moduleResolution": "node", diff --git a/packages/cli/generators/project/templates/_.gitignore b/packages/cli/generators/project/templates/_.gitignore index 050eec5fe6eb..94189d4dc6fd 100644 --- a/packages/cli/generators/project/templates/_.gitignore +++ b/packages/cli/generators/project/templates/_.gitignore @@ -62,3 +62,6 @@ api-docs/ # Transpiled JavaScript files from Typescript /dist + +# Cache used by TypeScript's incremental build +*.tsbuildinfo diff --git a/packages/cli/generators/project/templates/tsconfig.json.ejs b/packages/cli/generators/project/templates/tsconfig.json.ejs index 8ffddb55b332..18efabbcecf0 100644 --- a/packages/cli/generators/project/templates/tsconfig.json.ejs +++ b/packages/cli/generators/project/templates/tsconfig.json.ejs @@ -17,6 +17,8 @@ "resolveJsonModule": true, "skipLibCheck": true, + "incremental": true, + "lib": ["es2018", "esnext.asynciterable"], "module": "commonjs", "moduleResolution": "node", diff --git a/packages/cli/test/integration/generators/app.integration.js b/packages/cli/test/integration/generators/app.integration.js index 276cd7c04ca5..a20be99649a5 100644 --- a/packages/cli/test/integration/generators/app.integration.js +++ b/packages/cli/test/integration/generators/app.integration.js @@ -116,6 +116,10 @@ describe('app-generator specific files', () => { const pkg = JSON.parse(await readFile('package.json')); expect(pkg.scripts).to.have.property('migrate', 'node ./dist/migrate'); }); + + it('creates .gitignore', () => { + assert.fileContent('.gitignore', /^\*\.tsbuildinfo$/m); + }); }); describe('app-generator with docker disabled', () => {