Merge branch 'master' of https://github.com/maximegris/angular-electron
This commit is contained in:
@@ -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 |
|
||||
|
||||
7
main.ts
7
main.ts
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user