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.

increase speed with incremental builds in dev mode

See original GitHub issue

Type 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:closed
  • Created 5 years ago
  • Reactions:15
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
alan-agius4commented, Jul 22, 2020

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.

2reactions
MrFrankelcommented, Apr 16, 2019

@LPCmedia any progress on this? we are facing a similar issues and would happy to help too!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improving the speed of incremental builds - Apple Developer
Improving the speed of incremental builds. Tell the Xcode build system about your project's target-related dependencies, and reduce the compiler workload ...
Read more >
Optimize your build speed | Android Developers
Follow these tips to improve the build speed of your Android Studio project. ... Gather the output when we are in single mode...
Read more >
Speeding Up Webpack, Typescript Incremental Builds by 7x
Let's name some enemies of incremental build speed: ... Webpack 4 introduced the path info in the generated dev mode replacing module ids ......
Read more >
Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >
Advanced techniques to speed up the compile time in Xcode
This is a kind of incremental step that as a developer we should need to keep an eye every day. Phase-1: Setting the...
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