Files Gatsby Looks for in a Plugin
What files does Gatsby look for in a plugin?
All files are optional unless specifically marked as required.
package.json— [required] this can be an empty object ({}) for local plugins.nameis used to identify the plugin when it mutates Gatsby’s GraphQL data structure- if
nameisn’t set, the folder name for the plugin is used
- if
mainis the name of the file that will be loaded when your module is required by another application- if
mainisn’t set, a default name ofindex.jswill be used - if
mainisn’t set, it is recommended to create an empty index.js file with the contents//no-op(short for no-operation), as seen in this example plugin
- if
versionis used to manage the cache — if it changes, the cache is cleared- if
versionisn’t set, an MD5 hash of thegatsby-*file contents is used to invalidate the cache - omitting the
versionfield is recommended for local plugins
- if
keywordsis used to make your plugin discoverable- plugins published on the npm registry should have
gatsbyandgatsby-pluginin thekeywordsfield to be added to the Plugin Library
- plugins published on the npm registry should have
gatsby-browser.js— usage details are in the browser API referencegatsby-node.js— usage details are in the Node API referencegatsby-ssr.js— usage details are in the SSR API reference
Edit this page on GitHub