Skip to content

Commit

Permalink
fix: performance regression due to false position md5 (#413)
Browse files Browse the repository at this point in the history
* fix: performance regression due to false positive md5

* fix: improve hard modules test

Make sure the module used it's cached content and wasn't unbuilt and
then rebuilt.
  • Loading branch information
mzgoddard committed Jul 22, 2018
1 parent c94ed0f commit c670f73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/TransformNormalModulePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const needRebuild4 = function() {
return true;
}
const fileHashes = this.__hardSourceFileMd5s;
const cachedHashes = this.__hardSource_oldHashes;
const cachedHashes = this.__hardSourceCachedMd5s;
const resolvedLast = this.__hardSource_resolved;
const missingCache = this.__hardSource_missingCache;

Expand Down Expand Up @@ -429,7 +429,7 @@ const needRebuild3 = function() {
return true;
}
const fileHashes = this.__hardSourceFileMd5s;
const cachedHashes = this.__hardSource_oldHashes;
const cachedHashes = this.__hardSourceCachedMd5s;
const resolvedLast = this.__hardSource_resolved;
const missingCache = this.__hardSource_missingCache;

Expand Down
2 changes: 1 addition & 1 deletion tests/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ exports.itCompilesHardModules = function(fixturePath, filesA, filesB, expectHand
var shortener = new (require('webpack/lib/RequestShortener'))(path.resolve(__dirname, '../fixtures', fixturePath));
function walk(compilation) {
compilation.modules.forEach(function(module) {
if (module.cacheItem) {
if (module.cacheItem && module.buildTimestamp === module.cacheItem.build.buildTimestamp) {
hardModules.push(module.readableIdentifier(shortener));
}
});
Expand Down

0 comments on commit c670f73

Please sign in to comment.