mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-21 15:13:46 +01:00
electron build
This commit is contained in:
parent
bd26e2f9ca
commit
ac80be1b40
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.DS_Store
|
||||
.vscode
|
||||
Changelog.txt
|
||||
Netburner.txt
|
||||
@ -9,5 +10,9 @@ Netburner.txt
|
||||
/test/*.css
|
||||
.cypress
|
||||
|
||||
# tmp folder for electron
|
||||
.package
|
||||
.build
|
||||
|
||||
# editor files
|
||||
.vscode
|
||||
|
BIN
electron/icon.png
Normal file
BIN
electron/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
19
electron/main.js
Normal file
19
electron/main.js
Normal file
@ -0,0 +1,19 @@
|
||||
const { app, BrowserWindow, Menu } = require("electron");
|
||||
Menu.setApplicationMenu(false);
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
devTools: false,
|
||||
},
|
||||
});
|
||||
|
||||
win.removeMenu();
|
||||
win.maximize();
|
||||
win.loadFile("index.html");
|
||||
win.show();
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
});
|
7
electron/package.json
Executable file
7
electron/package.json
Executable file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"description": "A cyberpunk-themed programming incremental game",
|
||||
"main": "main.js",
|
||||
"author": "Daniel Xie"
|
||||
}
|
2437
package-lock.json
generated
2437
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,4 +1,9 @@
|
||||
{
|
||||
|
||||
"name": "bitburner",
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"version": "0.53.0",
|
||||
"main": "electron-main.js",
|
||||
"author": {
|
||||
"name": "Daniel Xie"
|
||||
},
|
||||
@ -114,14 +119,14 @@
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-middleware": "^3.7.3",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"worker-loader": "^2.0.0"
|
||||
"worker-loader": "^2.0.0",
|
||||
"electron": "^14.0.1",
|
||||
"electron-packager": "^15.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8 || <=9"
|
||||
},
|
||||
"homepage": "https://github.com/danielyxie/bitburner",
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"name": "bitburner",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/danielyxie/bitburner.git"
|
||||
@ -135,7 +140,6 @@
|
||||
"start": "http-server -p 8000",
|
||||
"start:dev": "webpack-dev-server --progress --env.devServer --mode development",
|
||||
"start:container": "webpack-dev-server --progress --env.devServer --mode development --env.runInContainer",
|
||||
"build": "webpack --mode production",
|
||||
"build:dev": "webpack --mode development",
|
||||
"lint": "npm run lint:jsts & npm run lint:style",
|
||||
"lint:jsts": "eslint --fix . --ext js,jsx,ts,tsx",
|
||||
@ -144,7 +148,7 @@
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"watch": "webpack --watch --mode production",
|
||||
"watch:dev": "webpack --watch --mode development"
|
||||
},
|
||||
"version": "0.53.0"
|
||||
"watch:dev": "webpack --watch --mode development",
|
||||
"package-electron": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png"
|
||||
}
|
||||
}
|
||||
|
14
package.sh
Executable file
14
package.sh
Executable file
@ -0,0 +1,14 @@
|
||||
# npm install electron --save-dev
|
||||
# npm install electron-packager --save-dev
|
||||
|
||||
mkdir -p .package/dist || true
|
||||
|
||||
cp index.html .package
|
||||
cp electron/* .package
|
||||
cp dist/engine.bundle.js .package/dist
|
||||
cp dist/engineStyle.css .package/dist
|
||||
cp dist/vendor.css .package/dist
|
||||
cp dist/engineStyle.bundle.js .package/dist
|
||||
cp dist/vendor.bundle.js .package/dist
|
||||
|
||||
npm run package-electron
|
Loading…
Reference in New Issue
Block a user