Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -135,6 +135,7 @@ See docs here - https://www.gatsbyjs.org/packages/gatsby-source-filesystem/
`**/yarn.lock`,
`**/node_modules`,
`../**/dist/**`,
...(pluginOptions.ignore || []),
],
})

Expand Down