-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Trunk.toml and make urls relative. #90
Conversation
This enables IDEs to live preview `dist/index.html` without any extra config (since they usually default to serving the whole repo). It also allows the template to work as-is on itch.io and any other services that serve the package under some path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thank you for this. I remember, that I had issues with itch hosting back in the day and failed to find a working trunk configuration. I ended up doing some sed stuff in CI which could now be removed: https://github.com/NiklasEi/bevy_game_template/blob/main/.github/workflows/release.yaml#L201
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The web build renders fine for me in the IDE now, but inputs don't seem to work. Do they work for you?
If there is anything to fix about input handling that could be done separately. I am happy to get rid of the sed scripts 👍
Do you mean keyboard and mouse inputs? Which IDE do you see this in? (Maybe we should move this to an issue). I've only been using RustRover's built-in server, which always opens in your default browser. On VS Code, the ritwickdey.LiveServer extension also opens on default browser. ms-vscode.live-server opens in a panel, but mouse seems to work. My guess would be any preview that displays inside the IDE might have some inputs captured by the IDE itself. BTW thanks for the reviews and for putting together this template; it's super useful to folks like myself who are new to Bevy and Rust 😁 |
I tested it in RustRover and IntelliJ. Opening it in a browser is fine and keyboard inputs work. I was testing it inside the IDE itself and that's when the inputs stop working. They seem to be captured by the preview (the canvas gets marked), but Bevy doesn't get them. I don't think we need an issue for it, since it works in browsers. Seems like in issue of the IDEs. |
This enables IDEs to live preview
dist/index.html
without any extra config (since they usually default to serving the whole repo).It also allows the template to work as-is on itch.io and any other services that serve the package under some path.