feature: add support for additional cache keys option #304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small fix 👍 Very good works! Thanks!
README.md
Outdated
new UglifyJsPlugin({ | ||
cache: true, | ||
additionalCacheKeys: { | ||
env: 'development', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad example, many people can use this from README
, just use myCustomVariable
name or something like
test/cache-options.test.js
Outdated
const plugin = new UglifyJsPlugin({ | ||
cache: true, | ||
additionalCacheKeys: { | ||
env: 'development', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also use other variable
👍 Updated with suggestions from @evilebottnawi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Not a fan of the complex default keys documentation. I think the README does not require so many details about the plugin internals.
@ooflorent i am not fan also, but it should be documented because in some case it is only one variant to invalidate cache |
In the past I've taken large, complex portions of a README and moved them out into separate |
@shellscape i think we can do this in other PR, not here |
@evilebottnawi @ooflorent what do you think about making I just realized, for my use-case, I need access to I'm proposing something similar to how cache-loader defines their |
@Rohit-L |
/cc @Rohit-L friendly ping |
Close in favor #320 |
PR for issue #303
This adds an option for user to pass additional keys to the default cache key generator for more customization, allowing the user to have more control, if needed, over what hits/misses in the cache.