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
6
votes
0 answers

Angular 6 - Routing correctly when importing a library/npm module with child routes

I have built an Angular 6 Library module following this guide and a dummy application running along my library so I can import and test modules during development. The Library Module I am importing from the Library has child routes. Which I think is…
Smiter
  • 1,069
  • 1
  • 14
  • 33
5
votes
1 answer

How to fix angular deprecate whitelistedNonPeerDependencies in favor of allowedNonPeerDependencies

I got the following warning in my cli and was wondering what was the new allowedNonPeerDependencies doing different. WARNING: Option "whitelistedNonPeerDependencies" is deprecated: Use "allowedNonPeerDependencies" instead.
Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78
5
votes
2 answers

Service is not under 'rootDir' in Angular secondary entry point

When compiling an Angular library, I am getting this error concerning rootDir of my sub libraries library/services/src/public-api.ts:31:15 - error TS6059: File 'C:/libname/library/services/src/orders/orders.service.ts' is not under 'rootDir'…
Jiri Kralovec
  • 1,487
  • 1
  • 10
  • 18
5
votes
2 answers

Correct way to package an Angular library to support Angular 8, 9 and 10

With Angular 10 being released, I am updating the version of Angular used to build a library + demo application to version 10. Generally this goes smoothly, and the library remains compatible with previous versions of Angular, but this doesn't seem…
Michael
  • 2,189
  • 16
  • 23
5
votes
1 answer

HOW-TO: Angular library divided in independent feature sub libraries

I am currently developing an Angular library (in Angular v 8.1.0) and wondering how is it possible to have it "split in different sub-libraries"? For example, Angular (@angular) is split somehow in different "parts"…
charliebrownie
  • 5,777
  • 10
  • 35
  • 55
5
votes
1 answer

Unable to use assets/images using ngPackagr to create angular modules

I am creating an angular reusable module using ngPackagr. Everything works fine there but the images that I am internally referring to are not coming up in the final build where I am installing the component. I have tried using the actions in the…
Jyotirmoy Pan
  • 837
  • 2
  • 10
  • 28
5
votes
1 answer

Angular 6 package intra-module dependencies

I'm trying to create a library with multiple modules but having difficulties with module dependencies. I'm using Angular 6 with: "@angular-devkit/build-ng-packagr": "^0.7.0-rc.3", "@angular-devkit/build-angular": "^0.7.0-rc.3", "ng-packagr":…
Duke Cyrillus
  • 1,217
  • 2
  • 14
  • 29
5
votes
0 answers

lazy loading:missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property

I created two application (first application is a library and another application consuming component from the library). The intention is to do lazy loading of an imported library. when I trigger ng serve it gives an error message, but when I…
user3637734
  • 101
  • 5
5
votes
1 answer

ng-packagr side effects - should I be worried?

When running command ng-packagr -p ng-package.json I get the following output Building Angular library - - - skipped 8 lines - - - Side effects in initialization of unused variable Cm [0:2339,29] Side effects in initialization of unused variable Jm…
erikvimz
  • 5,256
  • 6
  • 44
  • 60
5
votes
0 answers

Use external javaScript library in angular 4 Component Library created with ng-packagr

With lots of help from this excellent article by Nikolas LeBlanc, I'm trying to create an Angular 4 component library: https://medium.com/@nikolasleblanc/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e The…
mattstuehler
  • 9,040
  • 18
  • 78
  • 108
5
votes
1 answer

Embed json in ng-packagr

In an angular cli project, I managed to embed json like this add to typings.d.ts declare module "*.json" { const value: any; export default value; } import .json import * as data from '../assets/data.json'; But if I want to compile…
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
5
votes
1 answer

How to develop two angular modules locally where module A imports module B

When developing two local projects in angularjs(where one imports the other) I would simply run "npm link" in module B's folder and then run "npm link module-B" in my main module's folder and whenever I changed a file in module B I would see it…
Viktor Eriksson
  • 5,677
  • 3
  • 20
  • 24
4
votes
2 answers

How to add scss of Angular library to bundle using ng-packagr?

I am trying to create scss theming based Angular(ng 11) library which I will use in separate projects through private npm registry. Right now I am trying to add a global scss file into my library and bundle it with my library. What I want: let's say…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
4
votes
1 answer

ng-package.json Data path ".lib" should NOT have additional properties (externals)

I am updated my npm package from angular 7.2 to angular 8.2, the problem I have now in my ng-package.json is that Property externals is not allowed.? Here is my ng-package.json "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", …
Miomir Dancevic
  • 6,726
  • 15
  • 74
  • 142
4
votes
1 answer

Typescript: conflicting namespaces warning on Angular 9 project compilation with ng-packagr

I am unsure what is really to blame for this issue. I think it's Typescript, but it could be ng-packagr or Angular. It only started when I updated to Angular 9. Here is the message I get on my production build... WARNING: Conflicting namespaces:…