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

Angular Ivy In a Library Breaks enableResourceInlining

I have created a simple Angular library "test-pub" (using nx g @nrwl/angular:lib test-pub --publishable). Then I've added a very basic component to it. super.component.html:

super works!

super.component.ts: import { Component, OnInit } from…
Kirill Metrik
  • 384
  • 1
  • 2
  • 12
3
votes
2 answers

Angular 8: "Please add a @NgModule annotation" when including a library into another library

I want to use one of my shared libraries in another shared library, but I am getting ERROR: Unexpected value 'LibraryModule in ...' imported by the module 'TestlibModule in ...'. Please add a @NgModule annotation. The libraries are in separate…
Jakub Judas
  • 737
  • 6
  • 16
3
votes
0 answers

How to extend rollup configuration?

Is it possible to extend https://github.com/ng-packagr/ng-packagr rollup config to support things such as postcss?
Matt B.
  • 397
  • 1
  • 4
  • 7
3
votes
1 answer

Does @angular-devkit/build-ng-packagr:build have any configurable options?

I'm using the Angular CLI to build/package my component library, and I wanted to include the README.md from the root of the project instead of the file from the projects folder. So I wanted to see if the builder had any configuration options, but…
Reactgular
  • 52,335
  • 19
  • 158
  • 208
3
votes
1 answer

lerna publish and npm pack failing to package all the files in "dist" folder

I am trying to build my first Angular Component package using lerna and it was working pretty well until I realized I had to add "ng-packagr" to get all of the HTML bundled inline with the rest of the code. After adding that support and getting it…
Matt Hintzke
  • 7,744
  • 16
  • 55
  • 113
3
votes
1 answer

"No provider for ViewContainerRef" while using ng-packagr component

I have created a components library using angular cli ng generate library, with a component that uses *ngIf inside a module. After successfully build and install the library in my main project, when I try to use the component I am getting No…
itay oded
  • 978
  • 13
  • 22
3
votes
0 answers

Angular Library - ng-packagr is exporting private component/service/pipe/class

I'm creating a very big library of components, services, etc., so our organisation can focus only on domain code. In this library I have some components, service, etc. that must be kept private because they live within a certain context that I…
Vince
  • 1,279
  • 2
  • 20
  • 40
3
votes
0 answers

ng-package bundling fails due to missing files in dist folder

I forked an angular lib, added a new subfolder in projects/keycloak-angular/src/lib/core which has a .js and .d.ts file that exports a namespace. It is imported into two existing files to expand functionality. When running npm run build I get the…
cen
  • 2,873
  • 3
  • 31
  • 56
3
votes
1 answer

Error: Cannot find module '@angular/compiler-cli/src/perform_compile' when running ng-packagr

I have a new install of windows and I'm trying to run ng-packagr for the first time. I'm getting the error: Error: Cannot find module '@angular/compiler-cli/src/perform_compile' at Function.Module._resolveFilename (module.js:547:15) at…
Scottie
  • 11,050
  • 19
  • 68
  • 109
3
votes
0 answers

Angular error while building because external library - Unexpected value "BannerModule..."

I created a library in order to share some components between two different projects, using ng-packagr module. The structure of the lib is In my library The src/package.json : { "name": "my-ng-library", "version": "0.0.0", "license": "MIT", …
Donovant
  • 3,091
  • 8
  • 40
  • 68
3
votes
1 answer

Using ng-packagr it doesnt recognise my tsconfig paths

Using ng-packagr for my Angular 6 and AngularCLI app and it doesn't recognise my tsconfig paths with I do the build. A normal ng build --aot --prod works fine though. These are my paths: "paths": { "@app/*": ["src/app/*"], "@env/*":…
AngularM
  • 15,982
  • 28
  • 94
  • 169
3
votes
0 answers

ng-packagr and shared modules

I'm trying to package a module X with dependencies to Y using ng-pacakgr. X and Y have services and components. App/module structure is : ModuleX imports ModuleY X.forRoot() provides ServiceY. ServiceY is used in AppModule and ModuleX. AppModule…
Patrice
  • 1,404
  • 1
  • 14
  • 27
3
votes
0 answers

How to get ng-packagr to generate source maps

I made an Angular app with Angular CLI and added some packagr files to it. When I run pacakgr no source maps are generated to the dist folder. How do I make that happen? I have enabled them in tsconfig.json, which is all I would expect to do. Here…
Philip Beber
  • 1,115
  • 12
  • 18
3
votes
0 answers

*d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

Angular CLI: 1.7.3 Node: 8.9.4 OS: win32 x64 Angular: 5.2.9 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router @angular/cli: 1.7.3 : 0.3.2 : 0.3.2 : 0.3.2 :…
user3637734
  • 101
  • 5
3
votes
0 answers

Custom Angular Module, VsCode intellisense doesn't work for component

I've created an external module for angular and when i try to use it in my other project, VsCode doesn't understand the component tags. I'm using ng-packagr to create the module. example:
Vince
  • 1,279
  • 2
  • 20
  • 40