saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.69k stars 215 forks source link

How can I build a web app? #431

Closed GrayRabbit-FE closed 6 months ago

GrayRabbit-FE commented 6 months ago

I use nextron build a windows app, but now I need to transplant it to browser, is there any simple way to finish it?

bm777 commented 6 months ago

Can you share any snip code so that we can help you?

GrayRabbit-FE commented 6 months ago

it's a normal Nextron repo, the directory haven't been edited. image I know I can make a new next.js repo and copy file to new repo, but there are too many files and configurations. So I want to know if there is any command to export a next.js repo for browser end( a web app ). thank you!!!! (My English is bad, wish you can understand and I am willing to make further explanation for you if you don't understand! thanks again)

bm777 commented 6 months ago

Hey, I understand what you mean now. At this stage, you have developed a nextron app, and you would like to know how you could export it into next.js right? To my knowledge, I don't have any command over doing that. But that could be cool to have. If so, you can copy all your page and paste it in your new next.js project (with all your /api folder).

Psycokwet commented 6 months ago

How could that work out ? I mean there is still electron code specific, like ipc communication and other stuff, how copy pasting in a next app could work ?

bm777 commented 6 months ago

They are only logic right, you can rewrite your IPC communication code to the/api/your_method_file.js and it just works.

Psycokwet commented 6 months ago

Oh yeah, but it's not simply copy and pasting, there is a bit more to it that's what I meant

So yeah, redoing config, and replacing electron native stuff in a new next js app

bm777 commented 6 months ago

I can understand the pain, maybe, we can work on a tool to move logic from IPC com to the empty nextjs project.

To be honest, if we have to think about the relevancy of the topic, it seems fair to work on the opposite direction: moving from nextjs project to a nextron project or start a nextron app from a nextjs app.

GrayRabbit-FE commented 6 months ago

Yes, I am programing electron first. But with business growing, I find the necessity to make an web version product, so that's why I have this requirement. But I finally change some code and delete some electron related code(they are useless on web) then simply use

npx next build ./renderer

to build it. And it seems works well currently.

bm777 commented 6 months ago

Done.

leocarsons commented 4 months ago

@bm777 When will this feature be available?

bm777 commented 4 months ago

@liosummer , I mean, you can still do this 👇

Yes, I am programing electron first. But with business growing, I find the necessity to make an web version product, so that's why I have this requirement. But I finally change some code and delete some electron related code(they are useless on web) then simply use

npx next build ./renderer

to build it. And it seems works well currently.