N
Nuxt3mo ago
xuxchao

I want to ignore the generation of certain files when generating

I refer to information found that nitro. Hooks. Prerender: generate I found this really works, he is not generated file, but the page logic is performed, is there any way to make logical page does not perform?
2 Replies
kapa.ai
kapa.ai3mo ago
Hi @xuxchao. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources, using the nitro.hooks.prerender:generate hook in your nuxt.config.ts allows you to skip the generation of specific files during prerendering by setting route.skip = true. However, the documentation only describes that this prevents the file from being generated—it does not mention a way to prevent the page logic (such as the execution of asyncData, fetch, or other setup code) from running during the prerendering process. The hook is called for each route during prerendering, but the page logic is still executed before the hook decides to skip the output file. Therefore, according to the available documentation, there is no built-in way to prevent the page logic from executing when using the prerender:generate hook to skip file generation. The hook only affects the output, not the execution of the page logic itself Skipping Client Fallback Generation Runtime prerender configuration. If you need to fully prevent both file generation and page logic execution, the knowledge sources do not provide a solution for this scenario. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@491180576943112192> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?