wokring electron app build + simplified web build

This commit is contained in:
Jan Prochazka
2021-03-21 19:20:42 +01:00
parent 34f2fb2a0a
commit b7b9dde5ae
11 changed files with 80 additions and 34 deletions

View File

@@ -12,8 +12,7 @@ export function extractPluginIcon(packageManifest) {
return `https://raw.githubusercontent.com/${match[1]}/${match[2]}/master/icon.svg`;
}
}
// eslint-disable-next-line no-undef
return `${process.env.PUBLIC_URL}/unknown.svg`;
return 'unknown.svg';
}
export function extractPluginAuthor(packageManifest) {

View File

@@ -1,3 +1,8 @@
let apiUrl = null;
try {
apiUrl = process.env.API_URL;
} catch {}
export default function resolveApi() {
if (window['require']) {
const electron = window['require']('electron');
@@ -10,12 +15,8 @@ export default function resolveApi() {
}
}
// // eslint-disable-next-line
// const apiUrl = process.env.REACT_APP_API_URL;
// if (apiUrl) {
// if (apiUrl == 'ORIGIN') return window.location.origin;
// return apiUrl;
// }
return 'http://localhost:3000';
if (apiUrl) {
return apiUrl;
}
return window.location.origin;
}