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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/cache-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.1
Choose a base ref
...
head repository: webpack-contrib/cache-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.0
Choose a head ref
  • 6 commits
  • 24 files changed
  • 3 contributors

Commits on May 30, 2019

  1. chore: exclude outputs (#78)

    mistic authored and evilebottnawi committed May 30, 2019
    Copy the full SHA
    4b04614 View commit details
  2. Copy the full SHA
    687a6a4 View commit details
  3. Add option for custom compare function (#79)

    * chore(na): change default cache directory
    
    * chore(na): remove error changes
    
    * feat: add option for custom compare function
    
    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)
    
    * test(na): add a simple test for the compare function
    
    * chore(na): updated info on read me for compare fn
    
    * test(na): changed return value on compare test function
    
    * test(na): second compiler call to create cache  in the first place
    mistic authored May 30, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    47ba95b View commit details

Commits on May 31, 2019

  1. Precision option for rounding time passed on stats and dep in the com…

    …pare function (#80)
    
    * chore(na): change default cache directory
    
    * chore(na): remove error changes
    
    * feat: add "precision" option for rounding mtime
    
    Some tools truncate mtime. (tar rounds to the second by default)
    
    Adding this option would allow support for environments that use such tools.
    
    # Conflicts:
    #	src/index.js
    #	src/options.json
    
    * chore(na): remove param reassign to original vars
    
    * test(na): some more tests for compare function
    
    * test(na): add tests for precision option
    mistic authored May 31, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    972a6c4 View commit details

Commits on Jun 5, 2019

  1. chore(deps): update (#81)

    BREAKING CHANGE: minimum required nodejs version is `8.9.0`
    evilebottnawi authored Jun 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    71e9e68 View commit details
  2. Copy the full SHA
    b357e88 View commit details
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/coverage
/dist
/example
/node_modules
/test/fixtures
8 changes: 2 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module.exports = {
root: true,
plugins: ['prettier'],
extends: ['@webpack-contrib/eslint-config-webpack'],
rules: {
'prettier/prettier': ['error'],
},
};
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
};
20 changes: 20 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -130,3 +130,23 @@ This release is not backwards compatible with `Webpack 2.x` due to breaking chan
Migration: see webpack/webpack#5225
```

## Testing Your Pull Request

You may have the need to test your changes in a real-world project or dependent
module. Thankfully, Github provides a means to do this. Add a dependency to the
`package.json` for such a project as follows:

```json
{
"devDependencies": {
"cache-loader": "webpack-contrib/cache-loader#{id}/head"
}
}
```

Where `{id}` is the # ID of your Pull Request.

## Thanks

For your interest, time, understanding, and for following this simple guide.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: webpack
19 changes: 9 additions & 10 deletions .github/ISSUE_TEMPLATE/BUG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: 🐛 Bug Report
about: Something went awry and you'd like to tell us about it.

---

<!--
@@ -15,11 +14,11 @@ about: Something went awry and you'd like to tell us about it.
Head to StackOverflow or https://gitter.im/webpack/webpack.
-->

* Operating System:
* Node Version:
* NPM Version:
* webpack Version:
* cache-loader Version:
- Operating System:
- Node Version:
- NPM Version:
- webpack Version:
- cache-loader Version:

### Expected Behavior

@@ -32,13 +31,13 @@ about: Something went awry and you'd like to tell us about it.
### Code

```js
// webpack.config.js
// If your code blocks are over 20 lines, please paste a link to a gist
// (https://gist.github.com).
// webpack.config.js
// If your code blocks are over 20 lines, please paste a link to a gist
// (https://gist.github.com).
```

```js
// additional code, HEY YO remove this block if you don't need it
// additional code, HEY YO remove this block if you don't need it
```

### How Do We Reproduce?
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/DOCS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: 📚 Documentation
about: Are the docs lacking or missing something? Do they need some new 🔥 hotness? Tell us here.

---

<!--
@@ -26,5 +25,4 @@ Documentation Is:

### Please Explain in Detail...


### Your Proposal for Changes
### Your Proposal for Changes
13 changes: 5 additions & 8 deletions .github/ISSUE_TEMPLATE/FEATURE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: ✨ Feature Request
about: Suggest an idea for this project

---

<!--
@@ -15,14 +14,12 @@ about: Suggest an idea for this project
Head to StackOverflow or https://gitter.im/webpack/webpack.
-->

* Operating System:
* Node Version:
* NPM Version:
* webpack Version:
* cache-loader Version:
- Operating System:
- Node Version:
- NPM Version:
- webpack Version:
- cache-loader Version:

### Feature Proposal



### Feature Use Case
16 changes: 5 additions & 11 deletions .github/ISSUE_TEMPLATE/MODIFICATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: 🔧 Modification Request
about: Would you like something work differently? Have an alternative approach? This is the template for you.

---

<!--
@@ -15,19 +14,14 @@ about: Would you like something work differently? Have an alternative approach?
Head to StackOverflow or https://gitter.im/webpack/webpack.
-->

* Operating System:
* Node Version:
* NPM Version:
* webpack Version:
* cache-loader Version:

- Operating System:
- Node Version:
- NPM Version:
- webpack Version:
- cache-loader Version:

### Expected Behavior / Situation



### Actual Behavior / Situation



### Modification Proposal
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: 🆘 Support, Help, and Advice
about: 👉🏽 Need support, help, or advice? Don't open an issue! Head to StackOverflow or https://gitter.im/webpack/webpack.

---

Hey there! If you need support, help, or advice then this is not the place to ask.
Please visit [StackOverflow](https://stackoverflow.com/questions/tagged/webpack)
or [the Webpack Gitter](https://gitter.im/webpack/webpack) instead.
or [the Webpack Gitter](https://gitter.im/webpack/webpack) instead.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -32,4 +32,4 @@ This PR contains a:
migration path for existing applications.
-->

### Additional Info
### Additional Info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ yarn-debug.log*
/node_modules
/example/.cache-loader
/example/dist
/outputs
.DS_Store
Thumbs.db
.idea
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/coverage
/dist
/node_modules
/test/fixtures
CHANGELOG.md
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [4.0.0](https://github.com/webpack-contrib/cache-loader/compare/v3.0.1...v4.0.0) (2019-06-05)


### chore

* **deps:** update ([#81](https://github.com/webpack-contrib/cache-loader/issues/81)) ([71e9e68](https://github.com/webpack-contrib/cache-loader/commit/71e9e68))


### BREAKING CHANGES

* **deps:** minimum required nodejs version is `8.9.0`



### [3.0.1](https://github.com/webpack-contrib/cache-loader/compare/v3.0.0...v3.0.1) (2019-05-13)


4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -52,9 +52,11 @@ module.exports = {
| **`cacheKey`** | `{Function(options, request) -> {String}}` | `undefined` | Allows you to override default cache key generator |
| **`cacheDirectory`** | `{String}` | `findCacheDir({ name: 'cache-loader' }) or os.tmpdir()` | Provide a cache directory where cache items should be stored (used for default read/write implementation) |
| **`cacheIdentifier`** | `{String}` | `cache-loader:{version} {process.env.NODE_ENV}` | Provide an invalidation identifier which is used to generate the hashes. You can use it for extra dependencies of loaders (used for default read/write implementation) |
| **`write`** | `{Function(cacheKey, data, callback) -> {void}}` | `undefined` | Allows you to override default write cache data to file (e.g. Redis, memcached) |
| **`compare`** | `{Function(stats, dep) -> {Boolean}}` | `undefined` | Allows you to override default comparison function between the cached dependency and the one is being read. Return `true` to use the cached resource |
| **`precision`** | `{Number}` | `0` | Round `mtime` by this number of milliseconds both for `stats` and `dep` before passing those params to the comparing function |
| **`read`** | `{Function(cacheKey, callback) -> {void}}` | `undefined` | Allows you to override default read cache data from file |
| **`readOnly`** | `{Boolean}` | `false` | Allows you to override default value and make the cache read only (useful for some environments where you don't want the cache to be updated, only read from it) |
| **`write`** | `{Function(cacheKey, data, callback) -> {void}}` | `undefined` | Allows you to override default write cache data to file (e.g. Redis, memcached) |

## Examples

17 changes: 4 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
pool:
vmImage: ubuntu-16.04
strategy:
maxParallel: 5
maxParallel: 4
matrix:
node-12:
node_version: ^12.0.0
@@ -47,9 +47,6 @@ jobs:
node-8:
node_version: ^8.9.0
webpack_version: latest
node-6:
node_version: ^6.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
webpack_version: next
@@ -91,7 +88,7 @@ jobs:
pool:
vmImage: macOS-10.14
strategy:
maxParallel: 5
maxParallel: 4
matrix:
node-12:
node_version: ^12.0.0
@@ -102,9 +99,6 @@ jobs:
node-8:
node_version: ^8.9.0
webpack_version: latest
node-6:
node_version: ^6.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
webpack_version: next
@@ -146,7 +140,7 @@ jobs:
pool:
vmImage: windows-2019
strategy:
maxParallel: 5
maxParallel: 4
matrix:
node-12:
node_version: ^12.0.0
@@ -157,9 +151,6 @@ jobs:
node-8:
node_version: ^8.9.0
webpack_version: latest
node-6:
node_version: ^6.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
webpack_version: next
@@ -198,4 +189,4 @@ jobs:
displayName: 'Publish test results'
- script: curl -s https://codecov.io/bash | bash -s -- -t $(CODECOV_TOKEN)
condition: succeededOrFailed()
displayName: 'Submit coverage data to codecov'
displayName: 'Submit coverage data to codecov'
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ module.exports = (api) => {
'@babel/preset-env',
{
targets: {
node: '6.9.0',
node: '8.9.0',
},
},
],
5 changes: 3 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
ignore: ['package-lock.json'],
ignore: ['package-lock.json', 'CHANGELOG.md'],
linters: {
'*.js': ['eslint --fix', 'git add'],
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
},
};
Loading