Angular CLI:1.7.3节点:8.9.4操作系统:win32 x64 Angular:5.2.9 ...动画,通用,编译器,编译器 - cli,核心,表单... http,语言服务,平台浏览器..平台浏览器动态,路由器

@ angular / cli:1.7.3:0.3.2:0.3.2:0.3.2:1.2.0:1.10.2:0.3.2:0.3.2 typescript:2.5.3 webpack:3.11.0

我们在应用程序中对外部bundle模块进行延迟加载,使用ng-packagr创建外部bundle .

Source link:

外部模块:lazy-module应用程序:app-consume

重现问题的步骤 .

  • 使用"npm run cd"捆绑外部模块"lazy-module"

  • 使用“npm install dist.tgz”包含"app-consume"应用程序中的包

  • 当我们运行或构建app-consume应用程序时,使用“ng serve”或“ng build”它会失败

[注意:问题不会在“ng serve -aot”和“ng build -aot”,command]中重现

如果我们使用“ng serve”命令使用开发服务器为应用程序提供服务,则会失败并显示以下错误消息 . 错误:记录了TypeScript编译中缺少的bundle.d.ts . 请通过'files'或'include'属性确保它在您的tsconfig中

./node_modules/bundle/bundle.d.ts中的错误模块构建失败:错误:TypeScript编译中缺少D:\ consume \ node_modules \ bundle \ bundle.d.ts . 请通过'files'或'include'属性确保它在您的tsconfig中 . 丢失的文件似乎是第三方库的一部分 . 已发布库中的TS文件通常是包装严重的库的标志 . 请在库存储库中打开一个问题,以提醒其作者并要求他们使用Angular Package Format打包库 . 在plugin.done.then的AngularCompilerPlugin.getCompiledFile(D:\ consume \ node_modules \ @ngtools \ webpack \ src \ angular_compiler_plugin.js:674:23)(D:\ consume \ node_modules \ @ngtools \ webpack \ src \ loader . js:467:39)at process._tickCallback(internal / process / next_tick.js:188:7)

期望:能够在“ng serve”和“ng build”的帮助下运行和构建应用程序