question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng-packagr exports markdown files from all folders within a library

See original GitHub issue

For documenting my library, I’m using compodoc which allows to add additional markdown files (https://compodoc.github.io/website/guides/tips-and-tricks.html) to describe a component.

My libraries folder structure looks like this:

└── my-exported-component/
    β”œβ”€β”€ my-exported.component.ts
    β”œβ”€β”€ my-exported.component.spec.ts
    β”œβ”€β”€ my-exported.component.scss
    β”œβ”€β”€ my-exported.component.html
    β”œβ”€β”€ my-exported.module.ts
    └── my-exported.component.md
└── my-not-exported-component/
    β”œβ”€β”€ my-not-exported.component.ts
    β”œβ”€β”€ my-not-exported.component.spec.ts
    β”œβ”€β”€ my-not-exported.component.scss
    β”œβ”€β”€ my-not-exported.component.html
    β”œβ”€β”€ my-not-exported.module.ts
    └── my-not-exported.component.md
β”œβ”€β”€ package.json
└── index.ts
// index.ts
export * from './my-exported-component/my-exported.module';

When I build with ng-packagr :

{
  "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
  "src": "src/my-lib/lib",
  "dest": "dist/",
  "lib": {
    "entryFile": "index.ts"
  }
}

it creates the dist folder like this:

└── dist/
    β”œβ”€β”€ my-exported-component/
         β”œβ”€β”€ my-exported.component.ts
         β”œβ”€β”€ my-exported.module.ts
        └── my-exported.component.md
    β”œβ”€β”€ my-not-exported-component/
        └── my-not-exported.component.md
    β”œβ”€β”€ bundles/
    β”œβ”€β”€ package.json
    β”œβ”€β”€ etc..

It seems as ng-packagr copies all markdown files from all folders although I did not explicitly register these modules in my index.ts file. Is there a way to exclude them?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
comradesharfcommented, Nov 1, 2017

Hi @x1c0,

You can use version 1.4.1 npm install ng-packagr@1.4.1 instead of the newer version. There’s pull request merged to fixed this but still not released yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a library with dependent libraries defined via paths
When I trying a build lib which depends on other lib (in example case lib1) via ng build --project=lib1 ng-packagr builds a strange...
Read more >
Angular library - Ng-packagr: entrypoint and styleIncludePaths
styleIncludePaths is meant to be used when you want to resolve global styles within your lib during main app build: https://github.com/ng-Β ...
Read more >
Building an Angular Library with multiple entry points | Articles
In a newly created Angular library that's the only entry point that you have, and it exports all of your modules, components, services,...
Read more >
Creating Secondary Entry Points for your Angular Library
To make secondary entry points, we need to tell ng-packagr which folder to look for. This can be achieved by creating another package....
Read more >
Build an Angular Library With NgPackagr - Fireship
Inside this the lib folder create the following elements. src/ source code; package.json package definition; public_api.ts to export your publicΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found