Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add cache.storeFilter for filtering cached assets#19577

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cseas wants to merge7 commits intowebpack:main
base:main
Choose a base branch
Loading
fromcseas:feat-store-filter

Conversation

@cseas
Copy link

@cseascseas commentedJun 3, 2025
edited
Loading

Fixes#19359

What kind of change does this PR introduce?

Add a new config optioncache.storeFiles which gives the users an option to configure filtering for which assets should be excluded from cache.

Did you add tests for your changes?

Yes

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

exportinterfaceMemoryCacheOptions{
/**
* Additionally cache computation of modules that are unchanged and reference only unchanged modules.
* Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I didn't change this line. This was added automatically byyarn run fix:special

/**
* A function to filter which cache entries should be stored. Return false to skip storing a cache entry.
*/
storeFilter?:(identifier:string,data:any)=>boolean;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Function signature is similar to the one suggested by@alexander-akaithere but I'm not sure if there are any use-cases for filtering ondata.

Need input from the maintainers here. If it isn't required, I'll go ahead and remove thedata parameter.

@cseascseas marked this pull request as ready for reviewJune 3, 2025 08:17
Copy link
Member

@alexander-akaitalexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It should work for memory cache too, also please add test cases

cseas reacted with thumbs up emoji
@cseascseas marked this pull request as draftJune 3, 2025 17:00
@cseascseas marked this pull request as ready for reviewJune 9, 2025 11:28
@cseas
Copy link
Author

cseas commentedJun 9, 2025
edited
Loading

It should work for memory cache too, also please add test cases

@alexander-akait I've added the storeFilter property to MemoryCachePlugin as well. Also added unit tests for both IdleFileCachePlugin and MemoryCachePlugin. ✅

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexander-akaitalexander-akaitAwaiting requested review from alexander-akait

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Asset module binary files are stored in webpack cache

2 participants

@cseas@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp