【问题标题】:Angular 9 ngtypecheckAngular 9 ngtypecheck
【发布时间】:2020-10-07 12:45:33
【问题描述】:

更新到 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"
  ]
}

如何解决这些警告?

【问题讨论】:

  • 奇怪 - 我在 Ang 9 中没有这个警告,但我在升级到 Angular 10 后开始收到它

标签: angular angular9


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    @Felix 如果你使用@angular-builders/custom-webpack 包,由于@ngtools/webpack v9 依赖会导致警告

    GitHub issue has been already opened

    【讨论】:

      猜你喜欢
      • 2020-08-22
      • 2020-09-18
      • 2020-05-29
      • 2020-09-12
      • 2020-06-21
      • 2020-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多