Skip to content

Commit

Permalink
Add usePolling option
Browse files Browse the repository at this point in the history
In scenarios where the use of file system polling is necessary (network
file systems, hard links, etc)
  • Loading branch information
markphilpot committed Nov 7, 2022
1 parent 0ad6314 commit 75fb1b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gatsby-source-filesystem/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ exports.pluginOptionsSchema = ({ Joi }) =>
Joi.object().regex(),
Joi.function()
),
usePolling: Joi.boolean()
.default(false)
.description(
`When set to true, use file system polling instead of fsEvents`
),
})

exports.sourceNodes = (api, pluginOptions) => {
Expand Down Expand Up @@ -202,6 +207,7 @@ See docs here - https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/
`../**/dist/**`,
...(pluginOptions.ignore || []),
],
usePolling: pluginOptions.usePolling,
})

watcher.on(`add`, path => {
Expand Down

0 comments on commit 75fb1b1

Please sign in to comment.