У меня есть модуль, который имеет другие внешние зависимости. Я выполнил следующие шаги для создания новой библиотеки.
- ng новый тест-проект --create = application = false
- cd тест-проект
- нг g библиотекаmy-data
- ng g приложение-тестирование приложения
- ng build my-data
После этого я добавил свой селектор в приложение-тестирование приложения, а затемЯ пытался запустить мое приложение через ng serve testing-application. Как я уже упоминал выше, я использую внешние зависимости, в том числе ngx-file-drop и @ angular / material, поэтому, когда я, наконец, обслуживаю приложение, я сталкиваюсь с упомянутой ниже ошибкой.
ERROR in ../../dist/process-design/lib/process-design/process-design.component.d.ts:4:28 - error TS2307: Cannot find module 'ngx-file-drop'.
import { UploadFile } from "ngx-file-drop";
~~~~~~~~~~~~~~~
../../dist/process-design/lib/process-design/process-design.component.d.ts:5:30 - error TS2307: Cannot find module '@angular/material'.
import { MatPaginator } from "@angular/material";
IЯ добавил мои зависимости моей библиотеки в package.json библиотечного модуля, внутри devDependencies. Кроме того, когда я пытался собрать свою библиотеку, используя ng build my-data, я получал эти предупреждения, но был успешно собран.
WARNING: No name was provided for external module 'uuid' in output.globals – guessing 'uuid'
WARNING: No name was provided for external module 'ng-circle-progress' in output.globals – guessing 'ngCircleProgress'
WARNING: No name was provided for external module '@ng-bootstrap/ng-bootstrap' in output.globals – guessing 'ngBootstrap'
WARNING: No name was provided for external module 'angular-formio' in output.globals – guessing 'angularFormio'
WARNING: No name was provided for external module 'sweetalert' in output.globals – guessing 'swal'
WARNING: No name was provided for external module 'bpmn-js/dist/bpmn-modeler.production.min.js' in output.globals – guessing '_Modeler'
WARNING: No name was provided for external module 'bpmn-js-properties-panel' in output.globals – guessing '_PropertiesPanelModule'
WARNING: No name was provided for external module 'bpmn-js-properties-panel/lib/provider/bpmn' in output.globals – guessing '_BpmnPropertiesProvider'
WARNING: No name was provided for external module 'bpmn-js-properties-panel/lib/provider/camunda' in output.globals – guessing '_CamundaPropertiesProvider'
WARNING: No name was provided for external module 'bpmn-js-properties-panel/lib/factory/EntryFactory' in output.globals – guessing '_EntryFactory'
WARNING: No name was provided for external module 'bpmn-js/lib/features/palette/PaletteProvider' in output.globals – guessing 'PaletteProvider'
WARNING: No name was provided for external module 'lodash' in output.globals – guessing 'lodash'
WARNING: No name was provided for external module 'bpmn-js-properties-panel/lib/provider/camunda/element-templates' in output.globals – guessing 'elementTemplatesModule'
WARNING: No name was provided for external module 'camunda-bpmn-moddle/lib' in output.globals – guessing 'camundaExtensionModule'
WARNING: No name was provided for external module 'util' in output.globals – guessing 'util'
WARNING: No name was provided for external module 'file-saver' in output.globals – guessing 'fileSaver'
WARNING: No name was provided for external module 'bpmn-moddle' in output.globals – guessing 'BpmnModdle'
WARNING: No name was provided for external module 'ngx-file-drop' in output.globals – guessing 'ngxFileDrop'
WARNING: Creating a browser bundle that depends on Node.js built-in module ('util'). You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins ```