Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: There is no description of the content generated after build in the document #40217

Closed
szfdiwang opened this issue Sep 5, 2022 · 3 comments
Labels

Comments

@szfdiwang
Copy link

What is the improvement or update you wish to see?

After I execute NPM run build, the. Next file is output But I found that this file is very large. It contains a cache file and a webpack folder with a volume of 200 + MB I haven't seen any description about this in the document. How can I turn off this output (in fact, I deleted this file, but run start still works)

Is there any context that might help us understand?

image, I don't know how this cache is generated. I can't find the source in the document,

Does the docs page already exist? Please link to it.

No response

@szfdiwang szfdiwang added the Documentation Related to Next.js' official documentation. label Sep 5, 2022
@balazsorban44
Copy link
Member

The .next/cache/webpack folder is used to speed up builds in development (next dev) and, at build-time next build and is not actually necessary to be present in production.

We can add documentation around the purpose of that folder (or .next in general), so thanks for raising this issue!

FYI, if you are self-hosting and want the absolute smallest possible output, you can set the output: "standalone" option in next.config.js that will generate a .next/standalone folder that you can - as the name suggests - distribute as is, no node_modules etc. are necessary to copy. Check out the docs https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-files

If you are hosting on Vercel, you should not be concerned with this, as Vercel is going to make sure that your app is distributed the most optimal way.

@balazsorban44 balazsorban44 added area: documentation and removed Documentation Related to Next.js' official documentation. labels Sep 5, 2022
@manovotny
Copy link
Contributor

This is related to or a duplicate of #15498. Adding comments about this over there and closing this issue.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants