diff --git a/src/ts/config/webpack.config.js b/src/ts/config/webpack.config.js index 66e68d9bf8..c7e9a387e8 100644 --- a/src/ts/config/webpack.config.js +++ b/src/ts/config/webpack.config.js @@ -623,46 +623,35 @@ module.exports = function (webpackEnv) { }), // TypeScript type checking useTypeScript && - new ForkTsCheckerWebpackPlugin({ - typescript: { - typescriptPath: resolve.sync('typescript', { + new ForkTsCheckerWebpackPlugin({ + typescript: resolve.sync('typescript', { basedir: paths.appNodeModules, }), - configOverwrite: { - compilerOptions: { - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, - skipLibCheck: true, - inlineSourceMap: false, - declarationMap: false, - noEmit: true, - incremental: true, - }, - }, - context: paths.appPath, - diagnosticOptions: { - syntactic: true, - }, - mode: 'write-references', - // profile: true, - }, - issue: { - include: [ + async: isEnvDevelopment, + checkSyntacticErrors: true, + resolveModuleNameModule: process.versions.pnp + ? `${__dirname}/pnpTs.js` + : undefined, + resolveTypeReferenceDirectiveModule: process.versions.pnp + ? `${__dirname}/pnpTs.js` + : undefined, + tsconfig: paths.appTsConfig, + reportFiles: [ + // This one is specifically to match during CI tests, + // as micromatch doesn't match + // '../cra-template-typescript/template/src/App.tsx' + // otherwise. '../**/src/**/*.{ts,tsx}', '**/src/**/*.{ts,tsx}', - ].map(file => ({ file })), - exclude: [ - '**/src/**/__tests__/**', - '**/src/**/?(*.)(spec|test).*', - '**/src/setupProxy.*', - '**/src/setupTests.*', - ].map(file => ({ file })), - }, - logger: { - infrastructure: 'silent', - }, - }), + '!**/src/**/__tests__/**', + '!**/src/**/?(*.)(spec|test).*', + '!**/src/setupProxy.*', + '!**/src/setupTests.*', + ], + silent: true, + // The formatter is invoked directly in WebpackDevServerUtils during development + formatter: isEnvProduction ? typescriptFormatter : undefined, + }), // new ESLintPlugin({ // // Plugin options // extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],