Skip to content

Commit f41ce65

Browse files
author
Maxime GRIS
committed
misc/ clarify node lib import
1 parent 2964fc4 commit f41ce65

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ The application code is managed by `main.ts`. In this sample, the app runs with
6363
The Angular component contains an example of Electron and NodeJS native lib import.
6464
You can disable "Developer Tools" by commenting `win.webContents.openDevTools();` in `main.ts`.
6565

66+
## Use Electron / NodeJS / 3rd party libraries
67+
68+
As see in previous chapter, this sample project runs on both mode (web and electron). To make this happens, **you have to import your dependencies the right way**. Please check `providers/electron.service.ts` to watch how conditional import of libraries has to be done when using electron / NodeJS / 3rd party librairies in renderer context (ie. Angular).
69+
70+
## Browser mode
71+
72+
Maybe you only want to execute the application in the browser with hot reload ? Just run `npm run ng:serve:web`.
73+
6674
## Included Commands
6775

6876
|Command|Description|
@@ -79,11 +87,6 @@ You can disable "Developer Tools" by commenting `win.webContents.openDevTools();
7987

8088
YES! You can do it! Just by importing your library in npm dependencies section (not **devDependencies**) with `npm install --save`. It will be loaded by electron during build phase and added to your final package. Then use your library by importing it in `main.ts` file. Quite simple, isn't it ?
8189

82-
## Browser mode
83-
84-
Maybe you want to execute the application in the browser with hot reload ? Just run `npm run ng:serve:web`.
85-
**Note that you can't use Electron or NodeJS native libraries in this case.** Please check `providers/electron.service.ts` to watch how conditional import of electron/Native libraries is done.
86-
8790
## E2E Testing
8891

8992
E2E Test scripts can be found in `e2e` folder.

0 commit comments

Comments
 (0)