Skip to content

Commit

Permalink
feat(gatsby-source-filesystem): Added an 'ignore' property to the opt…
Browse files Browse the repository at this point in the history
…ions to ignore more files. (#8016)

* feat(gatsby-source-filesystem): Added an 'ignore' property to the options to ignore more files.

* docs(gatsby-source-filesystem): Added an options section to the README and fixed an error in the example.

* update default list
  • Loading branch information
Mike-Dax authored and pieh committed Sep 11, 2018
1 parent 29ce50e commit 3f67a2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/gatsby-source-filesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,30 @@ module.exports = {
options: {
name: `data`,
path: `${__dirname}/src/data/`,
ignore: [`**/\.*`], // ignore files starting with a dot
},
},
],
}
```

## Options

In addition to the name and path parameters you may pass an optional `ignore` array of file globs to ignore.

They will be added to the following default list:

```
**/*.un~
**/.DS_Store
**/.gitignore
**/.npmignore
**/.babelrc
**/yarn.lock
**/node_modules
../**/dist/**
```

## How to query

You can query file nodes like the following:
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby-source-filesystem/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/
`**/yarn.lock`,
`**/node_modules`,
`../**/dist/**`,
...(pluginOptions.ignore || []),
],
})

Expand Down

0 comments on commit 3f67a2f

Please sign in to comment.