I've succesfully deployed my Nextjs application on an IIS application (so root/subapplication). I do have some issues however. The way I currently deploy the application is by running next build and copying the build output (the .next folder) to the build folder that the IIS application looks at. Currently I also copy the node_modules and a custom web.config and server.js to the build folder. An iisnode folder is then later added by IISNode. So the folder looks like this:
|next-build
|_ .next
|_ node_modules
|_ web.config
|_ server.js
|_ iisnode
The problem:
When I add CI/CD into the mix, running a pipeline on our Azure Devops server, building an artifact and placing the artifact in build folder, the node_modules don't get updated. I know that Nextjs has a standalone output that includes the node_modules in the build but that version doesn't work as it can't find the node_module (issue has been addressed on the Vercel forums).
Surely there must be another way to add the node_modules automatically. I've been thinking about adding the possibility of adding a script to the staging area that run a yarn install when done. I don't know if this is possible as I've very little experience with Azure Devops. This would then require me to add the package.json instead.
Does anyone have any experience with this? I'd love to hear some ideas or suggestions.