13. Publishing your game
When you are happy with the game you’ve created and would like others to play it, it’s time to release. There are two ways in which you can make it available.
1. On the web
You'll need a folder that's accessible to a web browser for this option, so you'll need access to a (virtual) webserver. Cloud services like Microsoft Azure make it easy to set one up. When you have a server, prepare your game for publishing by running this command:
npx storyscript publish
After this, you can use FTP to copy the contents of the 'dist' folder in your StoryScript repository to your server. Then, you share a link to the game with your friends.
NOTE: StoryScript games are build as PWAs (Progressive Web Apps). That means they can be installed on Chromium based browsers and, using a browser extension, on FireFox. In Chrome, you can install a game hosted on a website like this:

Once you installed a StoryScript game, it is available offline. So you can play the game regardless of whether you're connected to the internet or not.
2. On Linux or Windows
To build and package the game into a portable executable that can run on Linux or Windows, StoryScript uses Electron. Publish your game using electron by running this command:
npx storyscript publish:electron
Note that on Windows, you need to run your IDE as administrator unless you have Windows developer mode enabled. The executable will end up in your repository's 'dist' folder. You can share this executable with your friends.
If you need to change the default electron configuration, you can find the electron.cjs file in your project folder.
