Bootstrap

Error: Projects must list all files or use an ‘include‘ pattern.

 import引入文件时,文件明明存在却报错:

File 'xxx/packages/@vue/src/use-list.ts' is not listed within the file list of project 'xxx/packages@/vue/tsconfig.json'. Projects must list all files or use an 'include' pattern.

解决方法:

 在 is not listed within the file 指明的文件中的 include 中添加或修改路径正则。

当前指明路径正则有问题的文件是tsconfig.json,所以到tsconfig.json文件中查看 include项。

tsconfig.json:
 

{
  "include": ["src"],
}

修改后的 tsconfig.json: 

{
  "include": ["src/**/*.ts"],
}

 

 

;