Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
themes.themes
? themes.themes
: flattenedPlugins.map(plugin => {
return {
themeDir: plugin.pluginFilepath,
}
})
)
const filesRegex = `*.+(t|j)s?(x)`
// Pattern that will be appended to searched directories.
// It will match any .js, .jsx, .ts, and .tsx files, that are not
// inside /node_modules.
const pathRegex = `/{${filesRegex},!(node_modules)/**/${filesRegex}}`
const modulesThatUseGatsby = await getGatsbyDependents()
let files = [
path.join(this.basePath, `src`),
path.join(this.basePath, `.cache`, `fragments`),
]
.concat(themeDirs.map(additional => path.join(additional, `src`)))
.concat(modulesThatUseGatsby.map(module => module.path))
.reduce(
(merged, folderPath) =>
merged.concat(
glob.sync(path.join(folderPath, pathRegex), {
nodir: true,
})
),
[]
)