_next folder name change #45422
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@TheHellTower Not sure if you're still stuck on this, but you can do something like this: cd into your build directory, possibly
or
Then rename the Solved my problem with deploying two static Next projects on the same domain. |
Beta Was this translation helpful? Give feedback.
-
Since there still is no way to configure this, we came up with a different approach. Maybe it's still relevant to anyone finding this thread. You can change the webpack configuration in next.config.(m)js, to change the names or foldernames of your code and css chunks. This way you can prefix them with a projectname for example, and then filter on that in your ingress configuration or wherever you route your users to the correct app or service.
Note: next/dynamic imports seem to go around this config and may require additional configuration. |
Beta Was this translation helpful? Give feedback.
@TheHellTower Not sure if you're still stuck on this, but you can do something like this:
cd into your build directory, possibly
out/
grep -rl '/_next' * | xargs sed -i 's|/_next|/next2|g'
or
grep -rli '_next' * | xargs -I@ sed -i '' 's/_next/next2/g' @
Then rename the
_next
directory itself tonext2
or whatever you want (as long as it matches the above command). If you're building to static, it'll likely be in theout/
directory.Solved my problem with deploying two static Next projects on the same domain.