After reading the docs I've been unable to find an answer if on gatsby build
I can exclude an entire directory or if it's excluded by default. For example if I have a directory on the main level:
Gatsby wouldn't be using or pulling anything from these directories and they'd only exist for production references. In my research I've read:
createPages
and I do not think would apply here.gatsby-plugin-exclude
: appears to be for pages and not necessarily for an entire directory.build
In Gatsby how can a directory be excluded on gatsby build
or would it be excluded in the build process?
I'm not sure if it will fit your requirements but one easy thing you can do is to create a project structure like:
/
|--/docs
|--/design
|--/code
|-- /.cache
|-- /public
|-- /src
|-- /pages
|-- /templates
|-- /static
|-- gatsby-config.js
|-- gatsby-node.js
|-- gatsby-ssr.js
|-- gatsby-browser.js
In that way, your /docs
and /design
will be outside the scope of Gatsby and when compiling/building your project, the only source code bundled will be the one inside in /code
.
A .git
file placed in the root (/
) will keep tracking all the file changes inside /docs
, /design
and /code
as well.