Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Add option for custom compare function #79

Merged
merged 15 commits into from
May 30, 2019

Conversation

mistic
Copy link
Collaborator

@mistic mistic commented May 30, 2019

This is a recreation of #71 where I preserved the original commits and added a test case, the only one I think it is worth it to have.

It's not always reliable to use mtime, so allowing for a compare function to be passed makes it possible for custom logic to be used. (ie. hashing)

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

In our CI environment, the mtime doesn't always match when it probably should, so we'd like to use something else (like file hashing). This is a simple update to expose a compare option that can be used to provide custom logic.

It's been mentioned before (#34 #41 #29)

Breaking Changes

No breaking changes

/CC @evilebottnawi

@codecov
Copy link

codecov bot commented May 30, 2019

Codecov Report

Merging #79 into master will increase coverage by 21.41%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #79       +/-   ##
===========================================
+ Coverage   57.81%   79.23%   +21.41%     
===========================================
  Files           2        2               
  Lines         128      130        +2     
  Branches       20       20               
===========================================
+ Hits           74      103       +29     
+ Misses         46       27       -19     
+ Partials        8        0        -8
Impacted Files Coverage Δ
src/index.js 79.84% <100%> (+21.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 687a6a4...b8760be. Read the comment docs.

@mistic mistic merged commit 47ba95b into webpack-contrib:master May 30, 2019
@fxxjdedd
Copy link

fxxjdedd commented May 8, 2020

The custom compare is not very useful, when we need to compare the hash of the file, the callback parameter of compare is not competent.

@fxxjdedd
Copy link

fxxjdedd commented May 8, 2020

#41

This pr feels more appropriate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants