File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 22const { app, BrowserWindow, Menu } = require ( "electron" )
33const path = require ( "path" )
44const menuTemplate = require ( "./menu-template" )
5+ const { format : formatUrl } = require ( "url" )
56
67function createWindow ( ) {
78 console . log ( "Creating window..." )
@@ -23,7 +24,13 @@ function createWindow() {
2324 if ( process . env . USE_DEV_SERVER ) {
2425 mainWindow . loadURL ( "http://localhost:6001" )
2526 } else {
26- mainWindow . loadFile ( `${ process . cwd ( ) } /build/index.html` )
27+ mainWindow . loadURL (
28+ formatUrl ( {
29+ pathname : path . join ( __dirname , "../build" , "index.html" ) ,
30+ protocol : "file" ,
31+ slashes : true
32+ } )
33+ )
2734 }
2835
2936 // Open the DevTools.
Original file line number Diff line number Diff line change 1111 "build:babel" : " cross-env NODE_ENV=production babel ./src --out-dir=./lib && cp ./package.json ./lib/package.json" ,
1212 "build:web" : " react-scripts build" ,
1313 "build:desktop" : " cross-env REACT_APP_DESKTOP=true PUBLIC_URL=./ react-scripts build && electron-builder build && cp ./desktop/entitlements.mac.plist ./build/entitlements.mac.plist" ,
14- "start:desktop" : " USE_DEV_SERVER=yes electron ./desktop" ,
14+ "start:desktop:dev" : " USE_DEV_SERVER=yes electron ./desktop" ,
15+ "start:desktop" : " electron ./desktop" ,
1516 "release:lib" : " npm run build && cd lib && npm publish" ,
1617 "release:desktop" : " npm run build:desktop && electron-builder --mac --windows --linux --publish always" ,
1718 "release" : " npm run release:desktop" ,
8687 ],
8788 "category" : " Development"
8889 },
89- "extends" : null
90+ "extends" : null ,
91+ "files" : [
92+ " **/*" ,
93+ " build/"
94+ ]
9095 }
9196}
You can’t perform that action at this time.
0 commit comments