From 75fb1b10c4fa1f83a794abc640683caf8c9f1fc8 Mon Sep 17 00:00:00 2001 From: Mark Philpot Date: Sun, 6 Nov 2022 21:25:18 -0800 Subject: [PATCH] Add usePolling option In scenarios where the use of file system polling is necessary (network file systems, hard links, etc) --- packages/gatsby-source-filesystem/src/gatsby-node.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/gatsby-source-filesystem/src/gatsby-node.js b/packages/gatsby-source-filesystem/src/gatsby-node.js index 8a2d70003962d..cb8df9e632262 100644 --- a/packages/gatsby-source-filesystem/src/gatsby-node.js +++ b/packages/gatsby-source-filesystem/src/gatsby-node.js @@ -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) => { @@ -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 => {