Skip to content

Commit ef33f5e

Browse files
committed
fix/ jslib in main process error
1 parent d8818c1 commit ef33f5e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ You can desactivate "Developer Tools" by commenting `win.webContents.openDevTool
7373

7474
**Your application is optimised. Only /dist folder and node dependencies are included in the executable.**
7575

76+
## You want to use a specific lib (like rxjs) in electron main thread ?
77+
78+
You can to this! Just by importing your library in npm dependencies (not devDependencies) with `npm install --save`. It will be loaded by electron during build phase and added to the final package. Then use your librairy by importing it in `main.ts` file. Easy no ?
79+
7680
## Browser mode
7781

7882
Maybe you want to execute the application in the browser with hot reload ? You can do it with `npm run ng:serve:web`.

main.ts

-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { app, BrowserWindow, screen } from 'electron';
22
import * as path from 'path';
33
import * as url from 'url';
44

5-
import { of } from 'rxjs';
6-
import { timeout } from 'rxjs/operators';
7-
85
let win, serve;
96
const args = process.argv.slice(1);
107
serve = args.some(val => val === '--serve');
@@ -45,8 +42,6 @@ function createWindow() {
4542
win = null;
4643
});
4744

48-
of(2000).pipe(timeout(1000))
49-
.subscribe(val => console.log(`ES5 works fine : @${val}`));
5045
}
5146

5247
try {

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-electron",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"description": "Angular 6 with Electron (Typescript + SASS + Hot Reload)",
55
"homepage": "https://github.com/maximegris/angular-electron",
66
"author": {
@@ -37,7 +37,8 @@
3737
"test": "npm run postinstall:web && ng test",
3838
"e2e": "npm run postinstall:web && ng e2e"
3939
},
40-
"dependencies": {},
40+
"dependencies": {
41+
},
4142
"devDependencies": {
4243
"@angular-devkit/build-angular": "0.6.3",
4344
"@angular/cli": "6.1.2",

0 commit comments

Comments
 (0)