Questions tagged [ng-packagr]

a tool to transpile your libraries to Angular Package Format

Resources:

  1. GitHub: https://github.com/dherges/ng-packagr
  2. NPM: https://www.npmjs.com/package/ng-packagr
  3. Example: https://github.com/dherges/ng-packaged
247 questions
0
votes
1 answer

How do I include post install scripts in an angular library?

I am building an angular library and have figured out how to get assets into the dist folder I'm using it to include a file called "postInstall.js", however I need to run the postInstall.js file, I can do that by including an NPM post install…
Raphael Castro
  • 907
  • 1
  • 8
  • 26
0
votes
1 answer

No name was provided for external module 'ngx-cookie-service' in output.globals – guessing 'ngxCookieService'

Using ng-packagr I got this error during the build: No name was provided for external module 'ngx-cookie-service' in output.globals – guessing 'ngxCookieService' My package.json looks like: { "$schema":…
NicoESIEA
  • 499
  • 1
  • 6
  • 23
0
votes
0 answers

Is it possible to have both internal and public API's in Angular libraries

How do I structure an Angular library, when I both want to have a public API/SDK and an internal API/SDK. The public API/SDK is for third party usage. The internal API/SDK is for internal usage. So what I want to achieve, is not to expose internal…
user1441610
  • 23
  • 1
  • 6
0
votes
1 answer

Copy lib assets to target dirctory with ng-packagr (Angular library)

with the new version of ng-packagr (9.0.1+) it is possible to copy assets from an Angular library into the dist folder. See also: https://github.com/ng-packagr/ng-packagr/blob/master/docs/copy-assets.md So far it works. However, I currently have the…
mactive
  • 61
  • 2
0
votes
1 answer

Specifying "resolveJsonModule": true When Running ng-packagr

I was given the requirement to include the version of my Angular 9 app as part of the HTML metadata. The version number is obtained from import { version } from '../../../package.json'; For both local and Azure DevOps pipeline build, we use…
fritz6
  • 73
  • 1
  • 16
0
votes
1 answer

Module never used warning while building Angular 9 library

Recently I updated one of my projects from Angular 8 to Angular 9. When I try to build the library I am getting this warning __read' is imported from external module 'tslib' but never used This warning was not there previously with version 8. I…
Rukshan Dangalla
  • 2,500
  • 2
  • 24
  • 29
0
votes
1 answer

Angular library PROD build throws exception

I have an Angular 9 library which I would like to push to registry. When I run ng build , it builds correctly, but it complains about Ivy: ****************************************************************************** It is not recommended…
jjczopek
  • 3,319
  • 2
  • 32
  • 72
0
votes
0 answers

Angular8 Library: 'rootDir' is expected to contain all source files

I am new at building Angular Library. I have created an angular library successfully from CLI. However, I wanted to add a new service(class) in the library. And while I want to build the library, its always throwing the error as in the screenshot: …
Mahmud
  • 1
  • 2
0
votes
0 answers

View Encapsulation Behaving Strangely

I am building a custom library with ng-packagr and an application that consumes the library. When I run the application, the styles from the library aren't working. When I look in the browser at the styles generated, I noticed something odd. It…
afriedman111
  • 1,925
  • 4
  • 25
  • 42
0
votes
1 answer

Lazy loaded route base url behaving strangely

I have created an Application with a Component Library. My library contains routes. When I try to lazy load the library into the application I use the following route: const routes: Routes = [ { path: 'test2', loadChildren: () => import('my-lib'…
afriedman111
  • 1,925
  • 4
  • 25
  • 42
0
votes
1 answer

Error when building with ng-packagr/angular

I'm using Angular 7 and building a library with ng-packagr. After upgrading to latest version of ng-packagr and lodash, I get this error ERROR: 'isString' is not exported by node_modules\lodash\lodash.js 'isString' is not exported by…
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
0
votes
1 answer

ng-packagr on Ionic 3 custom library

I need to build a set of libraries for my Ionic app, for reduce the time-to-market and have a sharable pieces of code. I found ng-packagr and i'm tring to figure out how to make it work with Ionic 3.9.5. During the build phase (running ng-packagr…
bott91
  • 263
  • 1
  • 3
  • 5
0
votes
0 answers

Packaging issues with barrels in angular 7 library

I am trying to create a library with multiple modules in it. My library structure is as below. I have multiple modules like common-ui. Problem 1 I have the module and i have index.ts files in each of the folders shown above, and from my public.ts i…
Vikhyath Maiya
  • 3,122
  • 3
  • 34
  • 68
0
votes
2 answers

Angular @Input inheritance causing weird compilation error with ng-packagr

I am experiencing a really obscure error message in Angular 7 when trying to use @Input inheritance. The error message does not make any sense because I have 1 mandatory @Input and 2 optional @Input so the math don't add up... Directive MyComponent,…
codenamezero
  • 2,724
  • 29
  • 64
0
votes
0 answers

how to sweeten ng-packagr secondary entry point path when consuming

Shared Component Setup I have a shared angular component, with as a secondary entry point a bunch of protractor utilities to make it easier to test from the consuming application. We don't do monorepo so the repository is dedicated only to that one…
Renaud
  • 4,569
  • 7
  • 41
  • 72