警告将Angular 7升级到9会得到警告

时间:2020-02-25 10:11:47

标签: angular angular9

在npm开始发出警告后更新我的项目中的Angular版本

WARNING in E:\bansi\project\BTT\BTT_new - angular 9.0.1\BTTReport_AspnetZero_New\BTTCorpAngular-master\src\app\btt-report\monthly-report\monthly-report.component.spec.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": [
  "src/main.ts",
  "src/polyfills.ts"
],
 "include": [
 "src/**/*.ts"
],
   "exclude": [
   "src/test.ts",
   "src/**/*.spec.ts"
  ]
}

Ivy Workspace: <error>

1 个答案:

答案 0 :(得分:0)

正如这里提到的:How to get rid of the warning .ts file is part of the TypeScript compilation but it's unused

从包含数组中删除 "src/**/*.ts" 可以解决问题。

或者您可以在 tsconfig.app.json

上的排除数组中添加未使用的文件
相关问题