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
1
vote
0 answers

Using translations provided by module(using ngx-translate module) in application

I have an application A1 containing module M1, which uses ngx-translate module. Module M1 is exported by ng-packagr and used by application A2 which also uses ngx-translate module. What i have noticed is TranslateHttpLoader loads the language files…
Goofy
  • 210
  • 1
  • 3
  • 17
1
vote
0 answers

Ivy compilation error - component not exported from top level entry file

I am following the Stencil guide for configuring an angular output target here and am facing a problem when it comes to exporting the generated angular components to make them accessible in a production build. The generated angular directory (from…
mindparse
  • 6,115
  • 27
  • 90
  • 191
1
vote
1 answer

ng-packagr cannot build the package Unexpected token Error: Unexpected token rollup.js

I'm trying to export my angular module as separate npm module. So I'm trying to do it with npm ( "packagr": "ng-packagr -p ng-package.json" All is going good until the "Compiling to FESM15": I paste logs underneath: ng-packagr -p…
Beerbox
  • 7
  • 3
1
vote
1 answer

Build Error with ng-packagr and material 2.0.0-beta.12

I am receiving a build error when I try to run ng-packagr with material: 2.0.0-beta.12 as a dependency. It's looking for node_modules/@angular/packages/material which the packages folder doesn't exist in node_modules so I get ENOENT: no such file or…
nmrichards
  • 353
  • 2
  • 8
0
votes
0 answers

ng-packagr: share code between sub-entries but exclude the shared code from distribution

I have an angular library with multiple secondary entry points: a and b. I do also have some code which is shared accross a and b. The shared code is located in another secondary entry point shared. From my knowledge I must have a secondary entry…
Mikelgo
  • 483
  • 4
  • 15
0
votes
0 answers

How configure ng-packagr to build library without optimizations

I have library which builds with ng-packagr. I need to debug some code in this library, but within another project. How can I configure my library build script without any optimizations (like unnamed chunks and minimized code)?
urglmorl
  • 33
  • 6
0
votes
0 answers

angular-cli any way to emitOnError (ignore typescript errors) for a library?

I'm well aware of the arguments against this, please spare me the moralizing. I'm porting an Angular 11 lerna bootstrap monorepo with a bespoke webpack setup to angular-cli and Angular 13. Because the original project somehow emitted on error, there…
Novaterata
  • 4,356
  • 3
  • 29
  • 51
0
votes
1 answer

Angular 12 build package error without any detail

I have an Angular 12 library project that built fine in the past (year or two ago), but now it is failing. The only output I'm seeing is as follows: Building Angular Package moduleName.startsWith is not a function There is no code in the project…
GS-Scooter
  • 71
  • 6
0
votes
0 answers

ng2-nouislider with ng-packgr

I have my custom Angular library where I would like to implement ng2-nouislider in one of my components. Everything works fine but when I try to build my project I get this error: error NG8007: The property and event halves of the two-way binding…
0
votes
1 answer

Entry point X has a circular dependency on Y

I have a component X which imports a component Y. In componentx.model.ts I defined some types and interfaces. In component Y I would like to use one of these interfaces so I import it with import { NiceInterface } from '@foo/bar/componentx'; The…
Juuro
  • 1,487
  • 5
  • 16
  • 27
0
votes
0 answers

Error: Module not found: Error: Package path ./icons is not exported from package

I created a svg icons library using angular-cli@14 and svg-to-ts and published it. In the demo project for the library, it works fine when I import any icon. When I consume this package in real angular project I got this error. Module not found:…
Fawad Mukhtar
  • 780
  • 5
  • 9
0
votes
0 answers

'Function calls are not supported in decorators' | Angular library

I am testing a 'ng-circle-progress' in my existing angular library where the NgCircleProgressModule has only .forRoot() method as initialization. But it throws error while creating a build using below cmd. ng build shared-lib --prod //…
0
votes
0 answers

Is it possible to extract the vendor chunk for an angular library?

I would like a vendor.js to accompany my angular library JavaScript. (This excludes the ts-js transpilation and enables analysis of domain only code). When I add "vendorChunk": true to the architect/builder/options or…
Mark Sawers
  • 121
  • 2
  • 8
0
votes
0 answers

Get Angular ng-packagr to resolve module export / import to .jsx file

I am trying to use ng-packagr to publish a jsx react component through an angular library. I have an angular app that consumes the library. The path of my component is ./projects/my-lib/src/lib/my-component.jsx. When I export it through the…
afriedman111
  • 1,925
  • 4
  • 25
  • 42
0
votes
0 answers

Publish React component / web component from an Angular library

I am looking to publish a react component and web component from an angular library. I followed a few tutorials that step you through creating a react component inside an angular library. For example you install react and react-dom into the…
afriedman111
  • 1,925
  • 4
  • 25
  • 42