Skip to content

Commit

Permalink
feat: add default configuration for electron production build
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Jun 15, 2019
1 parent f96a646 commit 2898203
Show file tree
Hide file tree
Showing 4 changed files with 1,021 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ This is a starting place for an electron menubar application based on typescript
## Usage

### Development
`npm start`
`npm run electron`

- `npm start`
- `npm run electron`

### Production
`npm run build`
`npm run electron:build`

- `npm run electron:build`

## Getting Started

Expand Down
6 changes: 4 additions & 2 deletions electron/electron.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { menubar } from "menubar";
import * as path from "path";

console.log("env", process.env.NODE_ENV);
const mb = menubar({
index: process.env.NODE_ENV === "development" ? "http://localhost:3000/index.html" : `file://${__dirname}/index.html`,
index: process.env.NODE_ENV === "development"
? "http://localhost:3000/index.html"
: `file://${path.join(__dirname, "../build/index.html")}`,
});

mb.app.on("ready", () => {
Expand Down
Loading

0 comments on commit 2898203

Please sign in to comment.