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

prerender: hooks #88

Closed
pi0 opened this issue Apr 12, 2022 · 2 comments · Fixed by #299
Closed

prerender: hooks #88

pi0 opened this issue Apr 12, 2022 · 2 comments · Fixed by #299
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Apr 12, 2022

nuxt/nuxt#11786

Most importantly prerender:route hook which can be useful to modify and inspect pretender results. (eg: for service-worker to inject it's script)

@pi0 pi0 added the enhancement New feature or request label Apr 12, 2022
@pi0 pi0 self-assigned this Apr 12, 2022
@pi0 pi0 mentioned this issue May 9, 2022
7 tasks
@pi0 pi0 removed their assignment Jun 16, 2022
@farnabaz
Copy link
Contributor

farnabaz commented Jun 17, 2022

We have a prerender:route hoo, but it is not useful. (Changing route data does not affect on generated content)
https://github.com/unjs/nitro/blob/cbc7ba3835df539116ca6560a85365615af55fbb/src/prerender.ts#L99

But this should move into generateRoute function, before persisting content into file

https://github.com/unjs/nitro/blob/cbc7ba3835df539116ca6560a85365615af55fbb/src/prerender.ts#L66-L68

WDYT @pi0

@pi0
Copy link
Member Author

pi0 commented Jun 20, 2022

Nice find @farnabaz. prerender:route is called outside as for generic error handling and stats purposes. We might introduce another predenrer hook and use before writeFileCall to allow extending to skipping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants