increase speed with incremental builds in dev mode
See original GitHub issueType of Issue
[ ] Bug Report
[ X ] Feature Request
Description
As an Angular dev using monorepos with multiple libs I need incremental builds to be faster.
Given an Angular application: app that consumes an angular library: lib using ng-packgr to build.
When working in “dev mode”, a.k.a incremental builds with a watch option, the recompilation is not fast enough. This causes additional issues when working with a monorepo where the lib is built and linked to an app. The app is recompiled several times as ng-packagr writes the various formats prescribed by the Angular Package Format and reloads several times.
Proposed solution
This was done with a simple fork of the project and the results are astonishing.
Add means to limit the generated formats as needed by the application consuming the library. This would apply to “dev” mode only.
- ability to disable UMD module generation.
- ability to set the “Flattened” ecmascript module type with an argument that specifies ES2015 | ES5 or both. this depends on what the app is using in the typescript compiler options.
- *.metadata.json and *.d.ts files would always generated.
Additional Info
We were able to implement this by forking the latest version 4.7.1 and the improvements are significant. The app still recompiles occasionally but not as often. This could also be resolved but would be a second improvement on this “selective” Angular Package Format watch mode.
My team and I are willing to contribute to build this feature but would need some guidance on the implementation details should this be a fit with ng-packagr.
-
should we add a second command in “bin” for dev mode ?
ng-packagr-dev -p ng-package.json —no-umd <—ES5 | --ES2015 >
-
should this be implemented with additional command line arguments ?
-
should this be configurable in package.json
What implementation would be acceptable and documentation needed as this derives from the official “Angular Package Format” ?
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 4.7.1
@angular/*: 7.1.*
typescript: 3.1.6
rxjs: 6.4.0
node: 10.15.1
npm: 6.8.0
Version Information
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:21 (7 by maintainers)
Top GitHub Comments
I have a PR in flight (https://github.com/ng-packagr/ng-packagr/pull/1704) which should help improve incremental builds quite a lot, if the problem persists after updating, kindly provide the exact timings for each steps, and more information about your library size.
Thanks.
@LPCmedia any progress on this? we are facing a similar issues and would happy to help too!