Angular 9 ngtypecheck

8

升级到Angular 9后,我收到了警告:

\src\main.ngtypecheck.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.
\src\polyfills.ngtypecheck.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

我的 tsconfig.app.json:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "types": []
  },
  "files": ["main.ts", "polyfills.ts"],
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

如何解决这些警告?


6
奇怪 - 我在 Angular 9 中没有收到这个警告,但在升级到 Angular 10 后开始收到。 - Felix
2个回答

8

@Felix如果您正在使用@angular-builders/custom-webpack包,警告是由于@ngtools/webpack v9依赖引起的。

GitHub问题已经被打开


1

当我配置@angular-devkit/build-angular 0.803.5和@angular-* 11.2.13时,出现了这些编译器错误。将@angular-devkit/build-angular升级到0.1102.14后,错误消失了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接