Next.js Discord

Discord Forum

Standalone application packaging/compiling into an executable

Unanswered
Serbian Hound posted this in #help-forum
Open in Discord
Avatar
Serbian HoundOP
A client is requesting that we install a Next 13 application on their infrastructure, we have everything running as standalone with a custom server, but I'm having trouble packaging everything into one single file that I can upload to their server.

I tried pkg (deprecated, doesn't work) and deno (couldn't get it to work either).

I thought about cloning and building the project in their machine, but my PM is against it. I think he's concerned with clients getting access to the source code, which is an unfortunate spot to be in 🙃

How is everyone else getting standalone applications to their clients?

6 Replies

Avatar
I am not really sure if this will work but you can:
- Clone repo on their server
- Build standalone application
- Keep .next, public and node_modules folder(and files like next.config etc)
- Delete the source code
- Run the application
Avatar
Serbian HoundOP
Thanks for the reply!! That is my current best solution, but it would be nice to not have to set-up the node environment on the client machine. Their environments are highly restricted and requesting permission to install something like node would delay everything by a month (acceptable but still annoying)
Avatar
maybe try to do the same but on your local machine/ci-cd pipeline and upload the build artifacts?
you will still need node env to actually run the application I think
Avatar
Serbian HoundOP
Yes, node env will be required to run the project from .next folder... in fact from what I've tested, using this setup, it would be easiest to just npm i -g next and run it from there
But we still need to install node, git and request download/upload access for specific ports/urls