Export Godot to HTML5
Back
How to Export Godot to HTML5
I. Export the Project
- Go to the Godot Project you want to export.
- Make a
build/web
folder in the project.
- Go to
Project -> Export
.
- Press
Add -> Web
.
- Set the Export Path to be
build/web/index.html
.
- Paste the following line into Head Include:
<script src="coi-serviceworker.js"></script>
- Set the Canvas Resize Policy to Adaptive (this isn’t required for it to run, but it’s nice to have the canvas fill up the whole screen when it runs).
- Press Export Project.
II. Host the Project
- Copy the folder containing the
project.godot
(your project folder) and paste it into the repository that’s hosting it.
- Go to the repository, you will be working from there from here on out.
- Add
coi-serviceworker.js
and enable-threads.js
in the build/web
folder of the project.
- Push your changes.
- You should be done now. Go to where your project is hosted and try it out.
coi-serviceworker.js
can be found at https://github.com/gzuidhof/coi-serviceworker/blob/master/coi-serviceworker.js
enable-threads.js
can be found at https://github.com/josephrocca/clip-image-sorter/blob/main/enable-threads.js