Add documentation for electron app build

Also adds a step in the build to run npm install in the electron
subfolder
This commit is contained in:
Martin Fournier 2021-12-30 21:45:57 -05:00
parent b578e09986
commit 2189c5b663
2 changed files with 29 additions and 1 deletions

@ -121,7 +121,29 @@ Inside the root of the repo run
After that you can open any browser and navigate to `localhost:8000` and play the game. After that you can open any browser and navigate to `localhost:8000` and play the game.
Saving a file will reload the game automatically. Saving a file will reload the game automatically.
#### Submitting a Pull Request
### How to build the electron app
Tested on Node v16.13.1 (LTS) on Windows
These steps only work in a bash-like environment, like MinGW for Windows.
```sh
# Install the main game dependencies & build the app in debug mode
npm install
npm run build:dev
# Use electron-packager to build the app to the .build/ folder
npm run electron
# When launching the .exe directly, you'll need the steam_appid.txt file in the root
# If not using windows, change this line accordingly
cp .build/bitburner-win32-x64/resources/app/steam_appid.txt .build/bitburner-win32-x64/steam_appid.txt
# And run the game...
.build/bitburner-win32-x64/bitburner.exe
```
### Submitting a Pull Request
When submitting a pull request with your code contributions, please abide by When submitting a pull request with your code contributions, please abide by
the following rules: the following rules:

@ -16,4 +16,10 @@ cp main.css .package/main.css
cp dist/vendor.bundle.js .package/dist/vendor.bundle.js cp dist/vendor.bundle.js .package/dist/vendor.bundle.js
cp main.bundle.js .package/main.bundle.js cp main.bundle.js .package/main.bundle.js
# Install electron sub-dependencies
cd electron
npm install
cd ..
# And finally build the app.
npm run electron:packager npm run electron:packager