Skip to content

Commit

Permalink
Update hashed-chunk-ids-plugin.js (#1753)
Browse files Browse the repository at this point in the history
This skips the hash function if the chunk.id is null and chunk.name is undefined. Assume that if the id is null and the name is undefined, then there is something wrong with that module and do not hold up the entire build process.
  • Loading branch information
bskimball authored and KyleAMathews committed Aug 10, 2017
1 parent c8e0e58 commit 29d5201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby/src/utils/hashed-chunk-ids-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ HashedChunkIdsPlugin.prototype.apply = function apply(compiler) {
compilation.plugin(`before-chunk-ids`, chunks => {
chunks.forEach(chunk => {
if (chunk.id === null) {
chunk.id = hashFn(chunk.name)
if (typeof chunk.name !== "undefined") {
chunk.id = hashFn(chunk.name);
}
}
})
})
Expand Down

0 comments on commit 29d5201

Please sign in to comment.