Building dynamic secondary entry points manually
See original GitHub issueType of Issue
[ ] Bug Report
[x] Feature Request
Description
I have a library of about 60 components each as a secondary entry point that is figured out dynamically by ng-packagr with a package.json as described in the instructions.
This works fine if I trigger the build like ng build components
; it creates all the secondary entry points and I can import them in my app.
However, I cannot build secondary entry points manually. When I try building a single component with:
$(npm bin)/ng-packagr -p projects/components/button
I get the following error:
BUILD ERROR
Cannot read property 'startsWith' of undefined
TypeError: Cannot read property 'startsWith' of undefined
at NgEntryPoint.flattenModuleId (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/ng-packagr/lib/ng-package-format/entry-point.js:142:27)
at NgEntryPoint.get flatModuleFile [as flatModuleFile] (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/ng-packagr/lib/ng-package-format/entry-point.js:104:56)
at NgEntryPoint.get destinationFiles [as destinationFiles] (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/ng-packagr/lib/ng-package-format/entry-point.js:75:37)
at entryPoints.map.entryPoint (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/ng-packagr/lib/ng-v5/package.transform.js:50:52)
at Array.map (<anonymous>)
at MapSubscriber.source$.pipe.operators_1.map.graph [as project] (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/ng-packagr/lib/ng-v5/package.transform.js:49:77)
at MapSubscriber._next (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/rxjs/internal/operators/map.js:86:35)
at MapSubscriber.Subscriber.next (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/rxjs/internal/Subscriber.js:103:18)
at SwitchMapSubscriber.notifyNext (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/rxjs/internal/operators/switchMap.js:122:26)
at InnerSubscriber._next (/home/elclanrs/Documents/ng-packagr-manual-compilation/node_modules/rxjs/internal/InnerSubscriber.js:30:21)
How To Reproduce
- Clone this repo: https://github.com/elclanrs/ng-packagr-manual-compilation
- Try compiling a single component with
$(npm bin)/ng-packagr -p projects/components/button
Expected Behaviour
I expect the button component to be compiled in the dist folder overriding what was there previously.
Ideally, it would be nice to be able to do ng build components/button
or ng build components --entry=button
or something like that.
Version Information
ng-packagr: 3.0.1
@angular/compiler: 6.0.3
rollup: 0.59.4
tsickle: 0.27.5
typescript: 2.7.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Creating Secondary Entry Points for your Angular Library
Implement secondary entry points · 1. Place the folders for secondary entry points directly under the library folder. · 2. Create additional ...
Read more >Secondary entry points in angular library - YouTube
Secondary entry points in angular library : We create a npm package using ng-packagr and also creates a secondary entry point for the ......
Read more >Angular 9 - The target entry-point has missing dependencies
Finally, don't forget to build your project with ng build --prod or you'll get an error about the new Ivy compiler when you...
Read more >Create a Dynamic CI group
Navigate to All > CSDM > Manage Technical Services > Application Service. · In the Application Services list view, click New to open...
Read more >Creating and discovering plugins
Often when creating a Python application or library you'll want the ... Packages can have metadata for plugins described in the Entry points...
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 @alan-agius4, Is there any plans to add ability for parallel builds? I have a lot of secondary endpoints and most of them doesn’t depend on each other. Currently every build takes too much time for me
Thanks for this request, but this is currently not planned.