Skip to content

Commit

Permalink
Make local plugin resolution resilient to package.json files without …
Browse files Browse the repository at this point in the history
…a name field (#9636)

Fixes #9559
  • Loading branch information
jedrichards authored and DSchau committed Nov 1, 2018
1 parent fc81eca commit d8a6af4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gatsby/src/bootstrap/load-plugins/load.js
Expand Up @@ -45,11 +45,11 @@ function resolvePlugin(pluginName) {
const packageJSON = JSON.parse(
fs.readFileSync(`${resolvedPath}/package.json`, `utf-8`)
)

const name = packageJSON.name || pluginName
return {
resolve: resolvedPath,
name: packageJSON.name || pluginName,
id: createNodeId(packageJSON.name, `Plugin`),
name,
id: createNodeId(name, `Plugin`),
version:
packageJSON.version || createFileContentHash(resolvedPath, `**`),
}
Expand Down

0 comments on commit d8a6af4

Please sign in to comment.