@@ -4,10 +4,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
44
55const cpus = os . cpus ( ) . length ;
66
7- // we use <max> - 2 workers for quadcore cpus and higher, two cpus are reserved
8- // for the ts checker plugin (which at least needs one).
9- const tsLoaderWorkers = cpus > 3 ? cpus - 2 : 1 ;
10- const forkTsCheckerWorkers = Math . max ( 1 , cpus - tsLoaderWorkers ) ;
7+ // we use <max> - 1 workers for tricore cpus and higher, one cpu will be preserved
8+ const tsLoaderWorkers = cpus > 2 ? cpus - 1 : 1 ;
119
1210/**
1311 * Common Development Config
@@ -65,12 +63,17 @@ exports = module.exports = (options) => ({
6563 new ForkTsCheckerWebpackPlugin ( {
6664 // don't block webpack's emit to wait for type checker, errors only visible inside CLI
6765 async : true ,
68- // increase performance on multicore systems
69- workers : forkTsCheckerWorkers ,
7066 // checkSyntacticErrors is required as we use happyPackMode and the thread-loader to parallelise the builds
7167 checkSyntacticErrors : true ,
7268 // Set the tsconfig.json path
7369 tsconfig : options . configFile ,
70+ // Make use of a new API comming with TypeScript 2.7
71+ // which allows to speed up the type checking
72+ // https://github.com/namics/webpack-config-plugins/issues/39
73+ useTypescriptIncrementalApi : true ,
74+ // To allow using this plugin even if there is no .ts or .tsx file
75+ // ignore "TS18003: No inputs were found in config file"
76+ ignoreDiagnostics : [ 18003 ] ,
7477 } ) ,
7578 ] ,
7679} ) ;
0 commit comments