我使用自定义私有库已有一段时间了,用于我们拥有的两个不同应用程序之间的某些共享组件。它已经运行了很长一段时间,但是最近我向它添加了几个新组件,而且似乎只有在进行prod构建时,这些组件和模块才丢失。奇怪的是,我添加的所有原始内容都还在那里,只是缺少了新的内容。
这是我所看到的错误的一个例子
WARNING in ./src/app/review-panel-lead/review-panel-
lead.component.ngfactory.js
50:431-458 "export 'ReviewPanelLabelService' (imported as 'i10') was
not found in '@memberclicks/review-panel-library'
WARNING in ./node_modules/@memberclicks/review-panel-
library/memberclicks-review-panel-library.ngfactory.js
53:2269-2290 "export 'FiltersPanelModule' (imported as 'i1') was not
found in '@memberclicks/review-panel-library'
WARNING in ./node_modules/@memberclicks/review-panel-
library/memberclicks-review-panel-library.ngfactory.js
53:2292-2313 "export 'FiltersPanelModule' (imported as 'i1') was not
found in '@memberclicks/review-panel-library'
真正奇怪的是,它在开发人员模式下工作得很好,只是在我运行ng build --prod
时不行
在某些背景下,我当前正在库的dist文件夹上运行npm pack
,并将生成的.tgz
文件推送到npm。我已经用新的导出更新了我的库public_api文件夹,旧的仍然可以在prod中工作,而新的却失败了:
export * from './lib/review-panel-library.service';
export * from './lib/review-panel-library-models';
export * from './lib/review-panel-library.module';
export * from './lib/components/public_api';
export * from './lib/modals/entry-modal/entry-modal.component';
export * from './lib/filters-panel/filters-panel.module';
export * from './lib/filters-panel/filters-panel.component';
export * from './lib/filters-panel/review-panel-label.service';
export * from './lib/filters-panel/manage-labels/manage- labels.component';
export * from './lib/chips/chips.module';
export * from './lib/chips/chips.component';
最后,新旧代码之间的唯一区别是新旧代码都存在于一个新模块中,而不是放置新旧模块的现有review-panel-library.module中。直到./libs/modals
的所有导出均有效,并且是review-panel-library.module的一部分,而其余部分则无效。
任何帮助将不胜感激!