Skip to content

Commit

Permalink
fix: parse and stringify data in serializers (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzgoddard authored May 30, 2018
1 parent f01d8ba commit c40fd30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/CacheEnhancedResolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class EnhancedResolveCache {
missingCacheSerializer = cacheSerializerFactory.create({
name: 'missing-resolve',
type: 'data',
autoParse: true,
cacheDirPath,
});
resolverCacheSerializer = cacheSerializerFactory.create({
name: 'resolver',
type: 'data',
autoParse: true,
cacheDirPath,
});
},
Expand Down
5 changes: 3 additions & 2 deletions lib/CacheMd5.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class Md5Cache {
md5CacheSerializer = cacheSerializerFactory.create({
name: 'md5',
type: 'data',
autoParse: true,
cacheDirPath,
});
},
Expand Down Expand Up @@ -371,7 +372,7 @@ class Md5Cache {

md5Ops.push({
key: relateNormalPath(compiler, file),
value: JSON.stringify(value),
value: value,
});
} else if (
!value.mtime &&
Expand Down Expand Up @@ -463,7 +464,7 @@ class Md5Cache {
for (const key in unbuildMd5s) {
md5Ops.push({
key: relateNormalPath(compiler, key),
value: JSON.stringify(unbuildMd5s[key]),
value: unbuildMd5s[key],
});
}
}
Expand Down
8 changes: 2 additions & 6 deletions lib/CacheModuleResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ModuleResolverCache {
moduleResolveCacheSerializer = cacheSerializerFactory.create({
name: 'module-resolve',
type: 'data',
autoParse: true,
cacheDirPath,
});
},
Expand Down Expand Up @@ -287,12 +288,7 @@ class ModuleResolverCache {
moduleResolveOps.push({
key: relateNormalModuleResolveKey(compiler, key),
value: moduleResolveCache[key]
? JSON.stringify(
relateNormalModuleResolve(
compiler,
moduleResolveCache[key],
),
)
? relateNormalModuleResolve(compiler, moduleResolveCache[key])
: null,
});
});
Expand Down

0 comments on commit c40fd30

Please sign in to comment.