doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.6k stars 1.46k forks source link

Slow build time. Default value of `src ` doczrc.js #1598

Open chmurson opened 3 years ago

chmurson commented 3 years ago

Background

We had a problem with Docz being super slow on Netlify platform, but also on our local computers. Due to default speed of Netlify build machines, the problem was especially noticeable there, rather than on powerful local dev machines.

We managed to reduce the build time (docz build) from ~770ms to ~130 by simply setting src property of doczrc.js to src subfolder, which is where we store all our source files.

The project is in monorepo (but that is hardly relevant here) and folder tree looks like that

.
└── ./
    └── packages/
        ├── ...
        └── shared/
            ├── src/
            │   ├── ... (folders with ts, tsx and mdx code)
            │   └── index.ts
            ├── doczrc.js
            ├── package.json
            └── ...

We spent a lot of time on debugging before tried to change configuration of doczrc.js.

Not having src value set to anything makes it ./, according to docs, so Docz/Gatsby must be scanning a lot of files and folder, like - I'm guessing - build folder, node_modules (these are very light in our case, as most of stuff is inside of monorepos root folder node_modules, no the package's), maybe even .docz folder itself.

Feature suggestion

Is to add some form of information to developer that most probably he does not want to stay with default value of src property. It could be one of:

thanks!

eddysims commented 3 years ago

I just came here to say that you save me from stabbing my eyeballs out waiting for docz to reload. Thank you.