Docs: warn about the usage of `outputFileTracingExcludes`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
What is the improvement or update you wish to see?
Tell people to make sure they use the leading ./ or a leading /. (see the edit)
Is there any context that might help us understand?
It was not obvious to me but I had a folder data to ignore so I used:
outputFileTracingExcludes: {
'*': ['data/**/*'],
},
I lost my hair because this was removing the folder node_modules/next/dist/lib/metadata/ for my standalone build, and I had to understand why.
It's not obvious at all when using data/**/* it would consider the folder metadata (moreover that is in the core of Next.js) (but I do understand the logic here, I think it would be better to warn people so they save spare time 👍 ).
Thank you,
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/pages/api-reference/next-config-js/output#caveats
EDIT:
I went too fast, using the leading ./ did not fix my issue. I don't understand why... if I do ./scripts/**/* the metadata folder is still present. So what is the wrong logic for data?
EDIT2:
My workaround for now is to list my current files one by one (hopping to not miss one in the future):
outputFileTracingExcludes: {
'*': [
'./data/initiatives/**/*',
'./data/domains.csv',
'./data/graph.json',
'./data/repositories.json',
'./data/tools.csv',
],
I searched for ./data into the next module and just found a reference to "../data/geo.dat". Since it seems a static file, I cannot imagine this specific had an impact to the rest.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked output-file-tracing caveats documentation page and review the section covering outputFileTracingExcludes. Reproduce the reported pattern if needed, then clarify the warning and examples so the documented behavior matches the supported usage and the issue's reported confusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100