8000 [Feature] Add `JITI_FORCE` to ignore and rebuild the cache · Issue #378 · unjs/jiti · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Feature] Add JITI_FORCE to ignore and rebuild the cache #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasion 8000 ally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
kricsleo opened this issue May 6, 2025 · 5 comments · May be fixed by #379
Open
1 task done

[Feature] Add JITI_FORCE to ignore and rebuild the cache #378

kricsleo opened this issue May 6, 2025 · 5 comments · May be fixed by #379
Labels
enhancement New feature or request

Comments

@kricsleo
Copy link
Member
kricsleo commented May 6, 2025

Describe the feature

Currently, we have two options:

  • Reuse cache with fsCache enabled (default)
  • Disable cache with fsCache disabled

But in some scenarios (especially debugging, e.g., debugging output with different configs), we might want to clean the previous cache and rebuild it (if fsCache is enabled). It's pretty much like the vite --force.

Since adding jiti clean to just delete all the caches wouldn't be that necessary (mostly referenced: vitejs/vite#10986), I think adding JITI_FORCE would be a lightweight solution.

Additional information

  • Would you be willing to help implement this feature?
@kricsleo kricsleo added the enhancement New feature or request label May 6, 2025
@pi0
Copy link
Member
pi0 commented May 6, 2025

What about JITI_CACHE: rebuild

@kricsleo
Copy link
Member Author
8000 kricsleo commented May 6, 2025

Isn't JITI_CACHE considered deprecated (as it's no longer mentioned in the docs) or replaced by JITI_FS_CACHE?
(This issue primarily concerns fsCache, given that we also have JITI_MODULE_CACHE.)

@pi0
Copy link
Member
pi0 commented May 7, 2025

Yes it is primary fs cache. We could also have dedicate flag JITI_REBUILD_FS_CACHE / rebuildFsCache (or invalidate*)

@kricsleo
Copy link
Member Author
kricsleo commented May 8, 2025

I agree with your suggestion to support three modes on the same config: fsCache: true | false | 'rebuild'. 👍

Regarding JITI_REBUILD_FS_CACHE, since it mainly influences JITI_FS_CACHE, if they're used together as JITI_REBUILD_FS_CACHE=true JITI_FS_CACHE=false, the behavior would be somewhat odd... If this isn't a concern, I'm okay with adding this extra config. ⚙️

@pi0
Copy link
Member
pi0 commented May 8, 2025

Adding another option might make better sense since it is a new functionality. First I was thinking of new cache building mode but it is more of a one-off mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0