Compiling and Start - marcialwushu/angular-electron GitHub Wiki

Compiling main.ts & starting electron
We are almost done now.
All that’s left to do is to compile our main.ts to JavaScript.
To do that, let’s create a new script inside of our package.json’s script section and call it electron.
While we are at it, we also need to tell electron the entry point of our electron application. We do so by specifying the “main”-property in the package.json.
{
"name": "angular-electron",
"version": "0.0.0",
"main": "electron/dist/main.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "ng build --base-href ./ && tsc --p electron && electron ."
},
...
That script first compiles our angular application using ng build.
Afterward, it compiles every typescript file inside of our electron folder.
Finally, it starts the electron application using the package.json at the projects’ root.
We can now start our app using npm:
npm run electron
Congratulations, you have created and launched your first electron application!