I am using a similar generate-sitemap script manually, thinking how to automate it on every new blog post (dynamic route). But I need to add the new sitemap.xml to the commit in order to push it to origin master, from where it is atomically deployed to vercel.
Is that possible with your first solution at build time?
Thank you very much for your article, I really enjoyed it 👍
I deploy my website using Vercel. Anytime my main branch changes, it triggers a build and runs my generate-sitemap through next.config.js. Since Vercel is running my script, I do not need to commit it to repository.
I am using a similar generate-sitemap script manually, thinking how to automate it on every new blog post (dynamic route). But I need to add the new sitemap.xml to the commit in order to push it to origin master, from where it is atomically deployed to vercel.
Is that possible with your first solution at build time?
Thank you very much for your article, I really enjoyed it 👍
I deploy my website using Vercel. Anytime my main branch changes, it triggers a build and runs my generate-sitemap through
next.config.js
. Since Vercel is running my script, I do not need to commit it to repository.Alright, so that would work out for me. Thank you!