如何为 Angular 5 构建 npm 包

  • 本文关键字:构建 npm Angular angular5
  • 更新时间 :
  • 英文 :


我尝试为 Angular 5 构建一个 NPM 模块。我尝试像另一个模块一样重复结构,例如: https://github.com/juristr/ngx-tabs-libdemo

但它不起作用... 安装软件包后,我看到错误:

./node_modules/ngx-chat/index.ts 中的错误 模块构建失败: 错误:/Users/user/Dropbox/Projects/testngsite/node_modules/ngx-chat/index.ts 在 TypeScript 编译中缺失。请确保它在 您的 tsconfig 通过"文件"或"包含"属性。丢失的文件 似乎是第三方库的一部分。已发布的 TS 文件 库通常是库打包不良的标志。请打开一个 库存储库中的问题,以提醒其作者并要求他们 使用 Angular 包格式 (https://goo 打包库。 gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (/Users/user/Dropbox/Projects/testngsite/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23) at plugin.done.then (/Users/user/Dropbox/Projects/testngsite/node_modules/@ngtools/webpack/src/loader.js:467:39) 在 在process._tickCallback(内部/进程/next_tick.js:188:7)

如何解决这个问题? 我的模块:https://github.com/wasteCleaner/ngx-chat

我已经使用 https://github.com/dherges/ng-packagr 一段时间了,效果很好。文档并不惊人,但可以完成工作。我渴望找到替代品,但现在我会推荐 ng-packagr。

最新更新