We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d223974 commit e6c1b3bCopy full SHA for e6c1b3b
src/app/providers/electron.service.ts
@@ -1,5 +1,7 @@
1
import { Injectable } from '@angular/core';
2
3
+// If you import a module but never use any of the imported values other than as TypeScript types,
4
+// the resulting javascript file will look as if you never imported the module at all.
5
import { ipcRenderer } from 'electron';
6
import * as childProcess from 'child_process';
7
@@ -10,6 +12,7 @@ export class ElectronService {
10
12
childProcess: typeof childProcess;
11
13
14
constructor() {
15
+ //Conditional imports
16
if (this.isElectron()) {
17
this.ipcRenderer = window.require('electron').ipcRenderer;
18
this.childProcess = window.require('child_process');
0 commit comments