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

AngularCLI+ng-packagr: Using 3rd party library with css dependencies like Leaflet for an angular component library

I'm creating an Angular component library providing several UI components. This library will be imported with npm in another angular project. For a major part of my components, it worked fine except for one which needed 3rd party library css file…
2
votes
1 answer

Resolving a library projects SASS files from an application in the same workspace?

Is it possible to resolve SASS contained in a workspace library using an approach that is similar to resolving ts files from an application within the same workspace? For context I'll setup a real workspace as follows: ng new theme-workspace…
Ole
  • 41,793
  • 59
  • 191
  • 359
2
votes
1 answer

How to declare a dependency as optional in an Angular Library?

We have an Angular library where we have multiple modules. Each module can be imported and used independently in parent projects. In one of those modules' component we have an import from a dependency called "libphonenumber-js", which we tried to…
akcasoy
  • 6,497
  • 13
  • 56
  • 100
2
votes
2 answers

Use JS script file in angular library

I am trying to create an angular library in which one of the service has to make use of web-sdk.js file by importing it. Everything is working perfectly fine when I create that service inside of the application itself rather than a library, but…
DuckDrick
  • 19
  • 3
2
votes
1 answer

How to import angular 13 library packaged SASS?

With Angular 13 and the ng-packagr when we publish SASS mixins with a library we need to add the library to exports in package.json and also declare an assets block in ng-package.json. These are the…
Ole
  • 41,793
  • 59
  • 191
  • 359
2
votes
0 answers

Angular ng-packgr for angular 8

I am converting an existing angular application to library. For the same I did all the necessary changes including all the dependcies. Now while running ng build for library, I am facing error Cannot find builder…
nisha
  • 23
  • 3
2
votes
0 answers

embedded assets of copied assets of library

In my library, I'm trying to embed an inline cssUrl of one of my copied assets but it's not working - the output of the background-image is still relative and not inline. notifications.scss .icon-info { background-image:…
Lior Kooznits
  • 623
  • 1
  • 5
  • 6
2
votes
2 answers

Global styles are not being applied to Angular library by adding "assets" to ng-package.json with ng-packagr

I am working on an angular library (version 9.1.11) with storybook, where I want to add styles globally. I know that for ng-packagr versions 9.x and above it is possible to copy assets into your library package as part of the build process to add…
Ariana Rubí
  • 73
  • 11
2
votes
0 answers

WARNING: No name was provided for external module 'primeng/inputtext' in output.globals – guessing 'inputtext'

I am using following versions Angular CLI: 11.0.7 Node: 10.24.1 primeng : 11.4.3 I using primeng with in angular library project, But get some warnings when I compile library WARNING: No name was provided for external module 'primeng/inputtext' in…
Satish Pokala
  • 304
  • 2
  • 10
2
votes
0 answers

Angular Library Debugging - WebStorm

We have created our own angular library and published those artifacts in AWS CodeArtifact. Those 2 artifacts we are importing into another project.I would like to debug those 2 libraries and want to add breakpoint, what's the best solution for this.…
Rakesh
  • 177
  • 2
  • 14
2
votes
1 answer

Angular Library copy assets not working ng-packagr

I am creating an angular library which will allow us to reuse a lot of filter components that we currently use (customer search, employee search, etc). In my library, I am importing scss files into my component's scss file (in this case telerik).…
Godrules500
  • 467
  • 6
  • 25
2
votes
1 answer

Target older version of Angular when building library with latest CLI?

I'm maintaining an Angular library built with the Angular CLI and while I'd like to use the latest version of the Angular tooling I don't want to force consumers of my library to update Angular too often. Is there a way to target an older version of…
2
votes
0 answers

Can I target ES2017 when using ng-packagr?

I am maintaining an Angular library that makes generous use of the async and await keywords. Debugging the resulting JavaScript code is troublesome when targeting ES5 due to all the polyfill action going on. Even with source maps present, the…
All Bogs
  • 395
  • 3
  • 6
2
votes
0 answers

Angular library / ng-packagr styles missing

I have built 2 angular component libraries (A and B) each inside their own Angular app. I installed library A in library B. Application B is using both libraries. The styles of components in library A are not displaying when I render it in…
afriedman111
  • 1,925
  • 4
  • 25
  • 42
2
votes
1 answer

Package Angular 6 library without dependencies

I have an Angular 6 library which contains couple of modules with its routes. This library also works as a standalone application. I have used ng-packagr to pack and publish the library. When packing all the dependencies included in package.json…
Sanket
  • 612
  • 5
  • 23