Aleksandr Gorin
Aleksandr Gorin

Reputation: 27

How to build npm package for Angular 5

I try to build a NPM module for Angular 5. I try to repeat structure like another modules, for example: https://github.com/juristr/ngx-tabs-libdemo

but it isn't works... After installing of my package I see error:

ERROR in ./node_modules/ngx-chat/index.ts Module build failed: Error: /Users/user/Dropbox/Projects/testngsite/node_modules/ngx-chat/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (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) at at process._tickCallback (internal/process/next_tick.js:188:7)

How can I solve this problem? My module: https://github.com/wasteCleaner/ngx-chat

Upvotes: 0

Views: 537

Answers (1)

Sebastian Perez
Sebastian Perez

Reputation: 456

I have been using https://github.com/dherges/ng-packagr for some time and works great. Documentation is not amazing but gets the job done. I'm eager to find alternatives but for now I would recommend ng-packagr.

Upvotes: 1

Related Questions