Skip to content

Commit

Permalink
Merge pull request #9 from thebuilder/patch-1
Browse files Browse the repository at this point in the history
Update to chunk.mapModules
  • Loading branch information
dogmatico committed Aug 15, 2017
2 parents 0f532d2 + 6b44e69 commit bfc4722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -19,7 +19,8 @@ WebpackChunkHash.prototype.apply = function(compiler)
{
compilation.plugin('chunk-hash', function(chunk, chunkHash)
{
var source = chunk.modules.map(getModuleSource).sort(sortById).reduce(concatenateSource, '')
var modules = chunk.mapModules ? chunk.mapModules(getModuleSource) : chunk.modules.map(getModuleSource)
var source = modules.sort(sortById).reduce(concatenateSource, '')
, hash = crypto.createHash(_plugin.algorithm).update(source + _plugin.additionalHashContent(chunk))
;

Expand Down

0 comments on commit bfc4722

Please sign in to comment.