Skip to content
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 occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] mfsu support invalidate cache with patch-package #10064

Open
mysteryven opened this issue Dec 14, 2022 · 0 comments
Open

[Feature Request] mfsu support invalidate cache with patch-package #10064

mysteryven opened this issue Dec 14, 2022 · 0 comments

Comments

@mysteryven
Copy link
Contributor

Background

当对 npm 包进行 patch 操作的之后,需要删除 mfsu 原有的缓存才能获得更新的效果。

Proposal

在缓存文件 MFSU_CACHE.json 中新增一项 hash,用于记录是否使用 patch 操作修改了 npm 包。

根据包管理工具的不同,有不同的生成规则:

  1. pnpm、yarn v2+。原生支持,变化反应到 lockfile 中,直接对其进行 hash
  2. yarn v1、npm。借助 patch-package,需对 patch 目录内文件做 hash

Additional context

参考链接:

  1. patch-package
  2. vite support patch-package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant