harryparkdotio / gatsby-plugin-exclude

exclude pages from gatsby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does not ignore Query

adardesign opened this issue · comments

I have a structure like this:

src/
...
_template
allProducts.js
...

In the gatsby-config.js I have the following (as the first plugin)

    {
      resolve: 'gatsby-plugin-exclude',
      options: { paths: ['/_templates/*', '/_templates/**', '/_pages/*'] },
    },

Now In the there is a Query, which is irrelevant (temporarily) how can I get gatsby to ignore reading this file or directory.. I am still getting errors

gatsby-plugin-exclude excludes output destinations (paths) from output, not files themselves

this plugin doesn't interact with the GraphQL layer of Gatsby, but rather the output layer.


are you using gatsby-source-filesystem?

since gatsby-source-filesystem has an ignore option, which might be what you're after

{
  resolve: `gatsby-source-filesystem`,
  options: {
    name: `data`,
    path: `${__dirname}/src/data/`,
    ignore: [`**/\.*`], // ignore files starting with a dot
  },
},