๐ฎ Consoles
One of the biggest drawbacks of creating a web-based game, is that browser support on consoles is limited or challenging. So if you intend to publish your game on consoles, you should consider using native engines.
Also, note that to make your game usable on consoles, youโll need to integrate the Gamepad API.
Wrappers
The Xbox One supports HTML / JS games via UWP apps and Hosted Web Apps.
It currently doesnโt seem possible to publish JavaScript games to PlayStation or Nintendo Switch.
That being said, Radical Fish Games was able to release their game CrossCode on Switch and PlayStation, by creating their own compiler and transforming JavaScript code to C++. They touch on the process in their blog posts here and here, and in this presentation.
Browsers
Alternatively, web games can be played in browsers on Xbox and PS4, but not PS5 or Switch. There are some tricks to access hidden browsers on these as well, but thatโs not something youโd want your users to go through to play your games).
Steam Deck
Steam Decks run the SteamOS Linux distribution. By publishing a Linux build of your game to Steam via Electron and Steamworks.js, it should work on Steam Deck. You might need the --no-sandbox
flag when building your Electron game. I havenโt done it myself, so please let me know if you have more info or if you can confirm this.