Next.js Discord

Discord Forum

Export build

Answered
Daggertooth pike conger posted this in #help-forum
Open in Discord
Daggertooth pike congerOP
I have a project which uses most of the nextjs features for example server action meaning its not a static site now i want to to is lets say i have a client and i do not want to give the source code to the client so now how can i export the build folder and run it. Is there any way i can do that so i can run my nextjs project from the build folder without using the source code?

13 Replies

standalone build sounds like what you are looking for
Daggertooth pike congerOP
how can i do that?
Answer
Daggertooth pike congerOP
alr thanks i will try it out and let you know
@joulev <https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files>
Daggertooth pike congerOP
Hey so sorry i took long because i did not had electricity and my laptop battery was 0. I did what you have said however there is no css
@joulev <https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files>
Daggertooth pike congerOP
and when i took a look at the code it is referencing to my main source code directory however when i will give to my client they will not have the source code so how does this standalone works
Daggertooth pike congerOP
All Worked Thanks a lot
@Daggertooth pike conger and when i took a look at the code it is referencing to my main source code directory however when i will give to my client they will not have the source code so how does this standalone works
Daggertooth pike congerOP
Just have a question regarding this is there any way that i can remove my directory name from the project
like here it shows where my project was located i do not want that. Is there any way i can remove those?
@Daggertooth pike conger like here it shows where my project was located i do not want that. Is there any way i can remove those?
oh wow interesting, didnt know it also stored this information. the build step cannot really be tampered with easily so i'd just suggest you move the source code to a dummy temporary folder (where the path string doesn't contain meaningful information), then build it there and send back the standalone built artefact
yeah that's what i would do. just use a temporary folder, like %localappdata%\Temp. in *nix operating systems then /tmp