"Cross build" next.js app for a different architecture #93034
Answered
by
icyJoseph
escherstair
asked this question in
Help
Goals
Non-Goals
BackgroundI need to develop my next.js app so that it can run both on amd64 and arm64 architectures running Linux.
I see that I can use --cpu flag of npm to download and install packages for a different architecture. I would like having an optional similar flag ProposalI would like having I can't help developing but I can help testing it. |
Answered by
icyJoseph
Apr 27, 2026
Replies: 1 comment 5 replies
|
sorry for pushig, but is there any way to get this behavior with next.js? |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right, because the problem would be either, at
installorpostinstall.next builduses SWC, which is itself a native binary - it has to match the builder arch - but it only outputs JS - you don't need it at runtime.next buildprocess, outputs other static files that do not depend on architecture (HTML, JS, CSS, etc)sharpPerhaps you'd need to install the versions for the architectures you need? With
pnpmyou'd use this: https://pnpm.io/settings#supportedarchitectures - this should include the architectures you want to deploy to.So then standalone would include them all - I believe - so…