Open danprince opened 4 years ago
The electron
branch currently works in development but not in production because it reads files over the file://
protocol which doesn't support ES modules.
Looks like there are a few ways to get around that:
This would involve running a http server as part of the node process, that serves up the static version of the game. Would probably need something that prevented port collisions and it'd probably flag up security warnings on some OS (why would a game need to open a port etc).
Could wait for/contribute the fixes for https://github.com/sindresorhus/electron-serve/issues/21 or write my own custom protocol wrapper so that the main file (and all subsequent requests) are served with the correct headers.
More details in this Gist https://gist.github.com/smotaal/f1e6dbb5c0420bfd585874bd29f11c43 Simpler version: https://gist.github.com/jarek-foksa/0f6e82bdaf8fb1962c9e14035a8725e4
Another option albeit a bad one, would be to load the live game's url. This is annoying because it means that the game wouldn't work offline, but also that it could update without you knowing.
Want a version that can be played in a desktop client. Probably Electron for ease, but might be worth looking into other platforms.