Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: dev script update #140

Merged
merged 2 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"axios": "^0.27.2",
"bootstrap-icons": "^1.9.1",
"chart.js": "^4.2.0",
"concurrently": "5.2.0",
"electron-is-dev": "^2.0.0",
"electron-squirrel-startup": "^1.0.0",
"eslint-import-resolver-typescript": "^3.5.1",
"ethers": "^5.7.1",
Expand All @@ -48,12 +50,14 @@
"tailwindcss-scoped-groups": "^2.0.0",
"ts-jest": "^29.0.3",
"typescript": "*",
"wait-on": "5.1.0",
"web-vitals": "^2.1.0",
"xmlbuilder": "^15.1.1",
"yup": "^0.32.11"
},
"scripts": {
"dev": "electron .",
"dev": "concurrently -k \"BROWSER=none npm start\" \"npm:electron\"",
"electron": "wait-on tcp:3000 && electron .",
"start": "BROWSER=none react-scripts start",
"build": "react-scripts build",
"test": "jest",
Expand Down
16 changes: 9 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const { app, BrowserWindow } = require('electron')
const path = require('path')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const url = require('url')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const isDev = require('electron-is-dev')

const createWindow = () => {
// Create the browser window.
Expand All @@ -19,13 +21,13 @@ const createWindow = () => {
mainWindow.maximize()

// and load the index.html of the app.
const startUrl =
process.env.ELECTRON_START_URL ||
url.format({
pathname: path.join(__dirname, '../build/index.html'),
protocol: 'file',
slashes: true,
})
const startUrl = isDev
? 'http://localhost:3000'
: url.format({
pathname: path.join(__dirname, '../build/index.html'),
protocol: 'file',
slashes: true,
})
mainWindow.loadURL(startUrl)
}

Expand Down
Loading