File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11.idea
2+ out
23.DS_Store
34node_modules
45/build
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ packagerConfig : {
3+ asar : true ,
4+ } ,
5+ rebuildConfig : { } ,
6+ makers : [
7+ {
8+ name : '@electron-forge/maker-squirrel' ,
9+ config : { } ,
10+ } ,
11+ {
12+ name : '@electron-forge/maker-zip' ,
13+ platforms : [ 'darwin' ] ,
14+ } ,
15+ {
16+ name : '@electron-forge/maker-deb' ,
17+ config : { } ,
18+ } ,
19+ {
20+ name : '@electron-forge/maker-rpm' ,
21+ config : { } ,
22+ } ,
23+ ] ,
24+ plugins : [
25+ {
26+ name : '@electron-forge/plugin-auto-unpack-natives' ,
27+ config : { } ,
28+ } ,
29+ ] ,
30+ } ;
Original file line number Diff line number Diff line change 1+ require ( 'dotenv' ) . config ( )
2+ const { app, BrowserWindow} = require ( 'electron' )
3+ const PROTOCOL = process . env . PROTOCOL || 'http'
4+ const HOST = process . env . HOST || 'localhost'
5+ const PORT = process . env . PORT || 3000
6+
7+ function start ( ) {
8+ const createWindow = ( ) => {
9+ const mainWindow = new BrowserWindow ( {
10+ width : 800 ,
11+ height : 600
12+ } )
13+ mainWindow . loadURL ( `${ PROTOCOL } ://${ HOST } :${ PORT } ` )
14+ }
15+ app . whenReady ( ) . then ( ( ) => {
16+ createWindow ( )
17+ app . on ( 'activate' , ( ) => {
18+ if ( BrowserWindow . getAllWindows ( ) . length === 0 ) createWindow ( )
19+ } )
20+ } )
21+ app . on ( 'window-all-closed' , ( ) => {
22+ if ( process . platform !== 'darwin' ) app . quit ( )
23+ } )
24+ }
25+
26+ if ( ! app . isPackaged ) {
27+ start ( ) ;
28+ }
29+
30+ if ( app . isPackaged ) {
31+ // Load server and run
32+ import ( 'alloctrl/build/index.js' ) . then ( start )
33+ }
You can’t perform that action at this time.
0 commit comments