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.

Can't make NG_PERSISTENT_BUILD_CACHE work

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

I am trying to use the new NG_PERSISTENT_BUILD_CACHE=1 variable, but I don’t see any improvements at all, so I’m looking to understand why it doesn’t work.

I have debugged in Angular code to verify that NG_BUILD_CACHE is set (it is) and that NG_PERSISTENT_BUILD_CACHE is available in process.env (it is).

By debugging, I saw that this cache is supposed to be in node_modules/.cache/angular-webpack Yet after a build I see nothing there.

What am I missing ?

🌍 Your Environment


Angular CLI: 12.1.0
Node: 14.17.0
Package Manager: npm 7.20.0
OS: linux x64

Angular: 12.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.0
@angular-devkit/build-angular   12.1.0
@angular-devkit/core            12.1.0
@angular-devkit/schematics      12.1.0
@angular/fire                   6.1.5
@schematics/angular             12.1.0
rxjs                            7.0.0-beta.10
typescript                      4.2.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
QuentinFarizoncommented, Jul 28, 2021

@alan-agius4 I see you’ve been working on this, thank you so much. I have tested it on my Ionic project, it works fine !

My build time now down from 60 to 37 seconds

0reactions
angular-automatic-lock-bot[bot]commented, Aug 28, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RFC] Persistent build cache by default Β· Issue #21545 - GitHub
Users can opt-in to the experimental build persistent cache using the NG_PERSISTENT_BUILD_CACHE=1 environment variable.
Read more >
NG_PERSISTENT_BUILD_CAC...
You seem to be using Windows cmd to run the command, and hence you are getting the error. The command: NG_PERSISTENT_BUILD_CACHE=1 ng serve....
Read more >
Angular on Twitter: "Angular v12.1 enables opt-in usage of the ...
It's an environment variable. Try `set NG_PERSISTENT_BUILD_CACHE=1` and then run build.
Read more >
ng cache - Angular
Angular CLI saves a number of cachable operations on disk by default. When you re-run the same build, the build system restores the...
Read more >
How to speed up Angular build times with caching - Medium
Drastically speed up your Angular build times by saving your ng build and jest caches. Up to a 75% percent decrease in build...
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