Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
#186 fix vite build for electron main
Browse files Browse the repository at this point in the history
  • Loading branch information
neil authored and neil committed Feb 7, 2023
1 parent 68602cb commit 61ecc1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pnpm dev
### dist
```sh
pnpm install
pnpm add -g vite
pnpm --filter desktop exec pnpm dist
```

Expand Down
7 changes: 6 additions & 1 deletion modules/desktop/electron/libs/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import { mkdirp } from 'mkdirp';
import path from 'path';
import fs from 'fs';
import { getTeaPath } from './teaDir';
import type { Session } from '../../src/libs/types';
import * as v1Client from './v1Client';

const sessionFilePath = path.join(getTeaPath(), 'tea.xyz/gui/tmp.dat');
const sessionFolder = path.join(getTeaPath(), 'tea.xyz/gui');

interface Session {
device_id?: string;
key?: string;
user?: any;
}

export async function initSessionData() {
fs.readFileSync(sessionFilePath);

Expand Down
4 changes: 2 additions & 2 deletions modules/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dev:all": "concurrently -n=svelte,electron -c='#ff3e00',blue \"pnpm dev:main\" \"pnpm dev:svelte\" \"pnpm dev:electron\"",
"dev:svelte": "vite dev",
"dev:electron": "electron electron/dist/electron.cjs",
"dev:main": "cd ./electron && pnpm vite build --watch",
"build:main": "cd ./electron && pnpm vite build",
"dev:main": "cd ./electron && vite build --config ./vite.config.js --watch",
"build:main": "cd ./electron && vite --config ./vite.config.js build --base .",
"pack": "electron-builder --dir --config electron-builder.config.cjs",
"dist": "pnpm build && electron-builder --config electron-builder.config.cjs",
"package": "pnpm build && electron-builder --config electron-builder.config.cjs",
Expand Down

0 comments on commit 61ecc1e

Please sign in to comment.