Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the .cache folder in parcel-bundler? Is it necessary to push the .cache folder to Github?

What is the .cache folder in parcel-bundler? Is it necessary to push the .cache folder to Github ?

like image 448
Llawliet Avatar asked Mar 15 '20 17:03

Llawliet


2 Answers

The .cache folder (or .parcel-cache in parcel v2) stores information about your project when parcel builds it, so that when it rebuilds, it doesn't have to re-parse and re-analyze everything from scratch. It's a key reason why parcel can be so fast in development mode. I think committing it to git would be a bad idea - it would add a large number of (unnecessary) changes to your commit history, and it could easily get out-of-sync with the code that generated it.

From this article:

Be sure to add .cache and dist to your .gitignore file to prevent committing these folders to Git. The .cache folder is used by Parcel as a temporary cache directory when building your app for development and production.

like image 96
Andrew Stegmaier Avatar answered Oct 31 '22 01:10

Andrew Stegmaier


A slight update on this answer, although it is practically the same response, would be that the command you now need to enter for parcel@^2.0.0-beta.1 is:

.parcel-cache

Add this to your .gitignore file and all the Blobs will be removed from your Untracked listed of files when you hit git status again.

Thank you for helping me resolve this issue!

like image 42
Dan Haddock Avatar answered Oct 31 '22 00:10

Dan Haddock