首页 > 解决方案 > Angular 5:TypeScript 编译中缺少。请通过 'files' 或 'include' 属性确保它在您的 tsconfig 中

问题描述

我按照这篇文章自定义 UI 组件:

https://github.com/akveo/nebular/blob/master/docs/articles/auth-ui.md

但在那之后,由于找不到文件,开始出现许多错误。文章说只复制组件文件夹。我修复了所有这些,但现在出现错误:

Module build failed: Error: C:\xampp\htdocs\utahclient\src\app\@theme\components\auth\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

http://prntscr.com/ji9gp0

下面是我的 tsconfig 文件:

{
  "compileOnSave": false,
  "compilerOptions": {
  "outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
  "node_modules/@types"
],
"lib": [
  "es2017",
  "dom"
],
"plugins": [
  { "name": "tslint-language-service"}
]
}
}

标签: angulartypescriptangular5

解决方案


推荐阅读