Creating a plugin that calls custom hooks in the user's gatsby-node.js file #29496
Unanswered
chrispytoes
asked this question in
Help
Replies: 1 comment 3 replies
-
You can do something like: const path = require(`path`)
const pathToPlugin = require.resolve(`gatsby-plugin-x`)
const pathToGatsbyNodefile = path.join(pathToPlugin, `gatsby-node.js`) Note, this might not work the way you expect as Gatsby restricts |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to retrieve the location of the main
gatsby-node.js
file from within my plugin (specifically a theme) so I can call my own custom hooks that the plugin user may define?Beta Was this translation helpful? Give feedback.
All reactions