0

描述 我已经从不同的应用程序中导出了包,并尝试在不同的应用程序中使用该包作为依赖项。尝试从该包中导入组件时出现以下错误。

  ERROR in ./src/app/core/component-dynamic-loader/component-dynamic-loader.component.ts
  Module not found: Error: Can't resolve 'avanade-packagr/src/app/modules/xd-components/xd-list-view/xd-list-view.component'

在 'C:\Users\aditi.malviya\work\xd.ng.starter.demo.app\src\app\core\component-dynamic-loader'

如何重现 index.ts:

 export * from './xd-components.module';

public_api.ts:

 export * from './src/app/modules/xd-components/index';

ng-package.json:

{
  "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
  "lib": {
  "entryFile": "public_api.ts"
},
  "externals": {
  "moment": "moment",
  "lodash": "lodash"
  }
}

进口声明

  import { XdListViewComponent } from 'avanade-packagr/src/app/modules/xd- 
  components/xd-list-view/xd-list-view.component';
4

0 回答 0