This commit is contained in:
Maxime GRIS
2018-01-12 02:10:42 +01:00
2 changed files with 7 additions and 2 deletions

View File

@@ -75,7 +75,7 @@ Your built files are in the /dist folder.
|Command|Description|
|--|--|
|`npm run start:web`| Execute the app in the brower |
|`npm run start:web`| Execute the app in the browser |
|`npm run electron:linux`| Builds your application and creates an app consumable on linux system |
|`npm run electron:windows`| On a Windows OS, builds your application and creates an app consumable in windows 32/64 bit systems |
|`npm run electron:mac`| On a MAC OS, builds your application and generates a `.app` file of your application that can be run on Mac |

View File

@@ -4,6 +4,7 @@ import * as path from 'path';
let win, serve;
const args = process.argv.slice(1);
serve = args.some(val => val === '--serve');
import * as url from 'url';
if (serve) {
require('electron-reload')(__dirname, {
@@ -24,7 +25,11 @@ function createWindow() {
});
// and load the index.html of the app.
win.loadURL('file://' + __dirname + '/index.html');
win.loadURL(url.format({
protocol: 'file:',
pathname: path.join(__dirname, '/index.html'),
slashes: true
}));
// Open the DevTools.
if (serve) {