Skip to content

Commit e00c252

Browse files
committed
Imports modules in main electron process from cdv-electron-modules.json
1 parent 7af81cc commit e00c252

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

bin/templates/platform_www/cdv-electron-main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const fs = require('fs');
2222
const { app, BrowserWindow } = require('electron');
2323
// Electron settings from .json file.
2424
const cdvElectronSettings = require('./cdv-electron-settings.json');
25+
// Electron main process modules
26+
const cdvElectronModules = require('./cdv-electron-modules.json');
2527

2628
// Keep a global reference of the window object, if you don't, the window will
2729
// be closed automatically when the JavaScript object is garbage collected.
@@ -84,5 +86,7 @@ app.on('activate', () => {
8486
}
8587
});
8688

89+
cdvElectronModules.forEach(mod => require(mod));
90+
8791
// In this file you can include the rest of your app's specific main process
8892
// code. You can also put them in separate files and require them here.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)