Skip to content

Commit

Permalink
Update hashed-chunk-ids-plugin.js
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 Aug 9, 2017
1 parent 7e13ef7 commit c376f9d
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 c376f9d

Please sign in to comment.