Then the plugin can begin to hook into Gatsby through Node and SSR APIs. For example, in the above structure, the correct way to load the plugin is: It can be added alongside any other 3rd party Gatsby plugins already included in your config.įor the plugin to be discovered when you run gatsby develop, the plugin’s root folder name needs to match the name used in the gatsby-config.js ( not the name it goes by in your package.json file). The plugin also needs to be added to your gatsby-config.js, because there is no auto-detection of plugins. Place the code in the plugins folder in the root of your project like this: If a plugin is only relevant to your specific use-case, or if you’re developing a plugin and want a simpler workflow, a locally defined plugin is a convenient way to create and manage your plugin code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |