The project I'm working has some problems running with the built in HttpServer (cors related, also need some files exported along the project), so every change I make, I need to export it to HTML to test it.

It may sound like a small thing, but I need 7 clicks to test any change (Project->Export->Export project->Save->Overwrite->Close dialog->refresh browser). So I think it would be worth investing some time in a tool to one-click export to web.

It seems that you can make a button with @tool to run some code. The question is, is there any way to export the project from GdScript?

Thanks in advance

Thanks! I just got it working:

  • I created a script in Ubuntu (in ~/bin) called godot_export.sh, and gave it permission to execute. This is the command:
    ~/GODOT/<godot executable> --export-release "Web Client" --headless --path <project path>

  • I set a shortcut through Ubuntu settings, to run the script, so I can export the project with Ctrl+E

Thanks for pointing me in the right direction!

In 3.5 at least in the top right corner there's a "run HTML5" button which starts a little server and everything.

    Erich_L
    Yes, that works fine for most projects, but in my case, I need to export it inside a bigger web project.

    Erich_L In 3.5 at least

    No, I think they removed that in 4.0, or it wasn't finished. It's also hard to test locally as you need to setup the local sever yourself (simple python http server doesn't work).

      cybereality I think they removed that in 4.0

      The feature is still in 4.0-stable. Instead of separate export-to-Android and HTML5-run-in-browser buttons, there's a single Remote Debug button with a drop-down menu to select the platform.

        DaveTheCoder Instead of separate export-to-Android and HTML5-run-in-browser buttons, there's a Remote Debug button with a drop-down menu to select the platform.

        UI failure.

          cybereality UI failure.

          I agree. The Remote Debug icon has some tiny obscure image. The HTML5 and Android icons were clearly understandable.

          And the text doesn't make sense either. Testing a game in a web browser on your local machine is not really "remote" or "debugging" any more than a new window is "remote".

          But it is a remote process that's being connected to. So technically right, just confusing to those that aren't aware of the details or 'in on it' so to speak.

            That's just the right time to fill an issue, don't you think ?
            Why wasting time here discussing this to the end of time ?

            One could also work a (big) bit and submit a PR ready to merge 🙂.

            Megalomaniak But it is a remote process that's being connected to.

            When you press play and a new window opens up, it's that a remote process as well?

              Submit it as an improvement suggestion on their Github. You'd be surprised how fast they respond. And having a working model - as you might - will get it done faster. People like you can make this engine better. Go for it.