angular - 已发布库中的 TS 文件通常是库打包不良的标志
问题描述
我正在尝试在 Ionic 4 中进行单元测试,因此我们制作了 mobilecore 库并放入 node_modules 并从那里我们使用组件、服务和装饰器(所有文件都是 ts 格式,它们不是 tsc 编译的)。
我创建了一个空白项目,并在主页中调用 @PageTrack 装饰器来跟踪 firebase 中的页面,我已将其包含在 tsconfig.spec.json 和 tsconfig.app.json 中,但仍然出现错误:
./node_modules/mobile-core/src/app/decorators/page-track.decorator.ts 中的错误模块构建失败(来自 ./node_modules/@ngtools/webpack/src/index.js):错误:D:\Testing TypeScript 编译中缺少 \testingdemo\node_modules\mobile-core\src\app\decorators\page-track.decorator.ts。请通过 'files' 或 'include' 属性确保它在您的 tsconfig 中。丢失的文件似乎是第三方库的一部分。已发布库中的 TS 文件通常是库打包不良的标志。请在库存储库中打开一个问题以提醒其作者并要求他们使用 AngularCompilerPlugin.getCompiledFile 中的 Angular 包格式打包库 (D:\Testing\testingdemo\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:869: 23) 在 plugin.done.then (D:
有人可以建议我哪里错了或者如何在使用时排除这个装饰器npm run test
解决方案
推荐阅读
- python - 当我使用另一个参数来决定它时,如何对列表的连续项目求和
- javascript - 如何使用流约束基于另一种类型的类型?
- python-3.x - 快速 Python 多线程处理 5000 个请求
- java - 为什么我们需要一个 Object 参数用于 equals 方法?
- grpc - 修改后的 Google pushtotalk.py 在缺少属性“DeviceRequestHandler”时崩溃
- python - 在另一个文件中查找一个文件中的记录的匹配项
- java - Itext 保护 pdf 不被修改
- arrays - 在 React Native 中映射状态数组
- angular - ng: 'mat-table' 不是已知元素
- c# - 重复消息,但不应在任务中重复此消息