Ability to disable sub entry points
See original GitHub issueType of Issue
[ ] Bug Report
[x] Feature Request
Description
As a library developer, I would like to have the possibility not to build sub entry points (for dev builds).
Details
We are experiencing build performance issues with our Angular library (30+ sub entries) even after migrating to Angular 10 (related to #1222).
lib build time (seconds) | ng 8 | non-Ivy (ng 10) |
---|---|---|
with sub-entries | 194 | 90.93 |
without sub-entries | 36 | 32.08 |
This is why we decided to have 2 separate builds:
- a production one with sub-entries so that the library is tree-shaked
- a development one without sub-entries - an
index.dev.ts
barrel that exports the sub-entries.
In order allow both builds without chaing the code, we created a custom Angular builder that:
- generates
package.json
files for each sub-entry - builds
- cleans-up previously generated
package.json
file.
Expected Behaviour
I would like to have a configuration flag so that ng-packagr ignores sub-entries. This way we can run ng-packagr for the dev build without the pre/post build processing.
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 10.1.0
@angular/compiler: 10.0.14
typescript: 3.9.7
rxjs: 6.6.3
node: 12.13.1
yarn: 1.21.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Creating Secondary Entry Points for your Angular Library
In this article, we will take a look at how we can utilise ng-packagr secondary entry points to split our Angular Library even...
Read more >How to only have secondary entry points in ng-packagr
I have an Angular CLI library where each component should only be imported through their individual entry-points (like Angular Material) :
Read more >Angular Libraries Adding Secondary EntryPoints - YouTube
This is the second part of Angular Libraries, where we add a secondary entrypoint to make Angular libraries Tree-shakable.
Read more >Classes | Entry Point Wiki - Fandom
Operatives are able to select a second starting perk to become a hybrid class once they have enough perk points, which are obtained...
Read more >Why and how to use secondary entrypoints in your Angular ...
By adding secondary entrypoints, we basically split our Angular libraries into multiple chunks, just like Angular Material does. A Example: // ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @SchnWalter
I generated a skeleton library and added 50 modules.
From what I can tell,
scheduleEntryPoints
is creating a lot of class instances for each entry point. We might be able to reduce the resource usage and the build duration by reusing some of the instances, but this will be tricky when it comes to external packages like themainNgcc process
from@angular/compiler-cli/ngcc
:https://github.com/ng-packagr/ng-packagr/blob/2f470e0b7742b1a517ddd2bb33c603344c3294c5/src/lib/ngc/ngcc-processor.ts#L57-L65
For any change, we’ll need to make sure that we don’t introduce regressions and we’ll need to start adding benchmarks and tests. And we’ll need to check with the Angular Core team if the
ngcc
process can be reused, it probably can, because we have support for live-reload.