-
-
Notifications
You must be signed in to change notification settings - Fork 9
How to bundle nextjs as a SEA #121
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
Comments
Does
|
@samsamurai301 -- I created https://github.com/BYK/fossilize to make using Node SEA easier and I think with some modifications, it can support Next.js projects directly. Right now it supports automatically embedding assets using a The way I use it currently is this little hack: https://github.com/getsentry/spotlight/blob/b09723c797fc9a537bf2e104a945f5979139781b/packages/spotlight/bin/run.js#L32-L41 Does that help? I'm happy to collaborate on this. |
@cspotcode For this I have to create a complete new project instead of modify in existing one, But for new project where I am needing something like that I will use the approach you wrote, Thanks for the help. |
Not really, no, it can run existing nodejs projects. I wouldn't have suggested it otherwise. |
Goal:
I am trying to create a standalone
.exe
(Windows executable) bundle of a Next.js application. My goal is to package the entire app, along with the Node.js runtime, into a single executable file that can be run on a Windows machine without requiring Node.js to be installed.What I've Tried:
I've followed the Next.js standalone export process (
output: 'standalone'
) and attempted to bundle it using the Node.js Self-Extracting Archive (SEA) feature, as described in the [official Node SEA documentation](https://nodejs.org/api/single-executable-applications.html). This process is relatively new and intended to replace older tools likepkg
andnexe
.Previously, I was able to generate
.exe
files using:[pkg](https://github.com/vercel/pkg)
[nexe](https://github.com/nexe/nexe)
However, both of these tools are now either unmaintained or lacking support for modern Node.js features and complex setups like those involving Next.js and ES modules.
Challenges:
next build
withoutput: 'standalone'
, integrating this with the SEA approach is proving difficult.loader.js
), embedding it into a Node binary, and including theblob
containing the app code..exe
file.What I’m Looking For:
I need a reliable, maintainable method for turning a Next.js application into a Windows executable using:
If anyone has successfully used Node SEA with a Next.js app, or has a working example or boilerplate for generating
.exe
files from a standalone build, I’d greatly appreciate any guidance or resources you could share.The text was updated successfully, but these errors were encountered: