Skip to content

Commit

Permalink
add plugin option examples
Browse files Browse the repository at this point in the history
add plugin option examples
  • Loading branch information
swyxio authored May 9, 2018
1 parent 3438a01 commit f0944cd
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion docs/docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,36 @@ module.exports = {
};
```

Plugins can take options. Note that plugin options will be stringified by Gatsby, so they cannot be functions.
Plugins can take options. Examples:

```javascript
module.exports = {
plugins: [
'gatsby-plugin-react-helmet',
{
// standard plugin with options example
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/data/`,
name: 'data',
},
},
{
resolve: 'gatsby-plugin-offline',
// blank options, equivalent to string-only plugin
options: {
plugins: [],
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
// plugins inside plugins, why not
plugins: [`gatsby-remark-smartypants`],
},
},
],
}
```

Note that plugin options will be stringified by Gatsby, so they cannot be functions.

0 comments on commit f0944cd

Please sign in to comment.