File tree 8 files changed +1387
-8
lines changed
8 files changed +1387
-8
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,5 @@ lerna-debug.log*
39
39
# Yarn
40
40
.yarn /*
41
41
! .yarn /releases
42
+ dist-electron
43
+ release
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @see https://www.electron.build/configuration/configuration
3
+ */
4
+ {
5
+ "$schema" : "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json" ,
6
+ "appId" : "YourAppID" ,
7
+ "asar" : true ,
8
+ "productName" : "YourAppName" ,
9
+ "directories" : {
10
+ "output" : "release/${version}"
11
+ } ,
12
+ "files" : [
13
+ "dist" ,
14
+ "dist-electron"
15
+ ] ,
16
+ "mac" : {
17
+ "target" : [
18
+ "dmg"
19
+ ] ,
20
+ "artifactName" : "${productName}-Mac-${version}-Installer.${ext}"
21
+ } ,
22
+ "win" : {
23
+ "target" : [
24
+ {
25
+ "target" : "nsis" ,
26
+ "arch" : [
27
+ "x64"
28
+ ]
29
+ }
30
+ ] ,
31
+ "artifactName" : "${productName}-Windows-${version}-Setup.${ext}"
32
+ } ,
33
+ "nsis" : {
34
+ "oneClick" : false ,
35
+ "perMachine" : false ,
36
+ "allowToChangeInstallationDirectory" : true ,
37
+ "deleteAppDataOnUninstall" : false
38
+ } ,
39
+ "linux" : {
40
+ "target" : [
41
+ "AppImage"
42
+ ] ,
43
+ "artifactName" : "${productName}-Linux-${version}.${ext}"
44
+ }
45
+ }
Original file line number Diff line number Diff line change 1
1
import { app , BrowserWindow } from "electron" ;
2
2
import path from "node:path" ;
3
+ import serve from "electron-serve" ;
3
4
4
5
// The built directory structure
5
6
//
@@ -15,6 +16,8 @@ process.env.VITE_PUBLIC = app.isPackaged
15
16
? process . env . DIST
16
17
: path . join ( process . env . DIST , "../public" ) ;
17
18
19
+ const loadURL = serve ( { directory : "dist" } ) ;
20
+
18
21
let win : BrowserWindow | null ;
19
22
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin - [email protected]
20
23
const VITE_DEV_SERVER_URL = process . env [ "VITE_DEV_SERVER_URL" ] ;
@@ -38,7 +41,8 @@ function createWindow() {
38
41
win . loadURL ( VITE_DEV_SERVER_URL ) ;
39
42
} else {
40
43
// win.loadFile('dist/index.html')
41
- win . loadFile ( path . join ( process . env . DIST , "index.html" ) ) ;
44
+ // win.loadFile(path.join(process.env.DIST, "index.html"));
45
+ loadURL ( win ) ;
42
46
}
43
47
}
44
48
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " my-qwik-basic-starter" ,
3
3
"description" : " Demo App with Routing built-in (recommended)" ,
4
+ "author" : " stenar.si" ,
5
+ "version" : " 0.0.1" ,
6
+ "main" : " ./dist-electron/main.js" ,
4
7
"engines" : {
5
8
"node" : " >=15.0.0"
6
9
},
22
25
"lint" : " eslint \" src/**/*.ts*\" " ,
23
26
"preview" : " qwik build preview && vite preview --open" ,
24
27
"start" : " vite --open --mode ssr" ,
25
- "qwik" : " qwik"
28
+ "qwik" : " qwik" ,
29
+ "build:electron" : " qwik build && electron-builder"
26
30
},
27
31
"devDependencies" : {
28
32
"@builder.io/qwik" : " ^1.3.0" ,
31
35
"@types/node" : " ^20.10.3" ,
32
36
"@typescript-eslint/eslint-plugin" : " ^6.13.2" ,
33
37
"@typescript-eslint/parser" : " ^6.13.2" ,
38
+ "electron" : " ^28.0.0" ,
39
+ "electron-builder" : " ^24.9.1" ,
40
+ "electron-serve" : " ^1.2.0" ,
34
41
"eslint" : " ^8.55.0" ,
35
42
"eslint-plugin-qwik" : " ^1.3.0" ,
36
43
"prettier" : " ^3.1.0" ,
37
44
"typescript" : " ^5.3.2" ,
38
45
"undici" : " ^5.26.0" ,
39
46
"vite" : " ^5.0.6" ,
47
+ "vite-plugin-electron" : " ^0.15.4" ,
48
+ "vite-plugin-electron-renderer" : " ^0.14.5" ,
40
49
"vite-tsconfig-paths" : " ^4.2.1"
41
50
},
42
51
"dependencies" : {
43
52
"sharp" : " ^0.33.0"
44
53
}
45
- }
54
+ }
You can’t perform that action at this time.
0 commit comments