Skip to content

Commit f3287ab

Browse files
committed
#62 Make current version part of cache key.
1 parent b25af33 commit f3287ab

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/FSCache.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('./utils/fs');
22
const path = require('path');
33
const md5 = require('./utils/md5');
44
const objectHash = require('./utils/objectHash');
5+
const pjson = require('../package.json');
56

67
// These keys can affect the output, so if they differ, the cache should not match
78
const OPTION_KEYS = ['publicURL', 'minify', 'hmr'];
@@ -10,8 +11,12 @@ class FSCache {
1011
constructor(options) {
1112
this.dir = path.resolve(options.cacheDir || '.cache');
1213
this.dirExists = false;
13-
this.invalidated = new Set;
14-
this.optionsHash = objectHash(OPTION_KEYS.reduce((p, k) => (p[k] = options[k], p), {}));
14+
this.invalidated = new Set();
15+
this.optionsHash = objectHash(
16+
OPTION_KEYS.reduce((p, k) => ((p[k] = options[k]), p), {
17+
version: pjosn.version,
18+
})
19+
);
1520
}
1621

1722
async ensureDirExists() {

0 commit comments

Comments
 (0)