Skip to content

Commit 6229363

Browse files
author
Doge Chan
committed
add build conf
1 parent 1020fba commit 6229363

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

docker-build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
docker run --rm -ti \
2+
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
3+
--env ELECTRON_CACHE="/root/.cache/electron" \
4+
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
5+
-v ${PWD}:/project \
6+
-v ${PWD##*/}-node-modules:/project/node_modules \
7+
-v ~/.cache/electron:/root/.cache/electron \
8+
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
9+
electronuserland/builder:wine

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": null,
77
"main": "./dist/electron/main.js",
88
"scripts": {
9-
"build": "node .electron-vue/build.js && electron-builder",
9+
"build": "node .electron-vue/build.js && electron-builder --win --linux",
1010
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
1111
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
1212
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
@@ -44,14 +44,17 @@
4444
"icon": "build/icons/icon.icns"
4545
},
4646
"win": {
47-
"icon": "build/icons/icon.ico"
47+
"icon": "build/icons/icon.ico",
48+
"target": "portable"
4849
},
4950
"linux": {
50-
"icon": "build/icons"
51+
"icon": "build/icons",
52+
"target": "AppImage"
5153
}
5254
},
5355
"dependencies": {
5456
"axios": "^0.18.0",
57+
"material-design-icons-iconfont": "^4.0.2",
5558
"rss-parser": "^3.5.3",
5659
"vue": "^2.5.16",
5760
"vue-electron": "^1.0.6",

src/main/index.dev.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
// Install `electron-debug` with `devtron`
1111
require("electron-debug")({ showDevTools: true });
1212

13+
var fs = require("fs");
14+
path =
15+
"/home/chan/.config/google-chrome/Default/Extensions/nhdogjmejiglipccpnnnanhbledajbpd/4.1.5_0";
16+
1317
// Install `vue-devtools`
1418
require("electron").app.on("ready", () => {
1519
let installExtension = require("electron-devtools-installer");
@@ -20,9 +24,11 @@ require("electron").app.on("ready", () => {
2024
console.log("Unable to install `vue-devtools`: \n", err);
2125
});
2226
if (process.env.NODE_ENV === "development") {
23-
require("electron").BrowserWindow.addDevToolsExtension(
24-
"/home/chan/.config/google-chrome/Default/Extensions/nhdogjmejiglipccpnnnanhbledajbpd/4.1.5_0"
25-
);
27+
fs.exists(path, function(exists) {
28+
if (exists) {
29+
require("electron").BrowserWindow.addDevToolsExtension(path);
30+
}
31+
});
2632
}
2733
});
2834

src/main/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function createWindow() {
3131
width: 1280
3232
// frame: false
3333
});
34-
34+
mainWindow.setMenu(null);
3535
mainWindow.loadURL(winURL);
3636
// mainWindow.webContents.session.setProxy(
3737
// { proxyRules: "socks5://127.0.0.1:1080" },
@@ -54,7 +54,7 @@ function createWindow() {
5454
mainWindow.webContents.send("resize", mainWindow.getSize());
5555
});
5656
}
57-
57+
app.commandLine.appendSwitch("--no-proxy-server");
5858
app.on("ready", createWindow);
5959

6060
app.on("window-all-closed", () => {

0 commit comments

Comments
 (0)