Skip to content

Commit

Permalink
chore: dev script update (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickimoore authored Mar 3, 2023
1 parent 13113ee commit 90d9a21
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 11 deletions.
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

0 comments on commit 90d9a21

Please sign in to comment.