Skip to content

Commit

Permalink
Imports modules in main electron process from cdv-electron-modules.json
Browse files Browse the repository at this point in the history
  • Loading branch information
zorn-v committed Jan 22, 2020
1 parent 7af81cc commit e00c252
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/templates/platform_www/cdv-electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const fs = require('fs');
const { app, BrowserWindow } = require('electron');
// Electron settings from .json file.
const cdvElectronSettings = require('./cdv-electron-settings.json');
// Electron main process modules
const cdvElectronModules = require('./cdv-electron-modules.json');

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

cdvElectronModules.forEach(mod => require(mod));

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
1 change: 1 addition & 0 deletions bin/templates/platform_www/cdv-electron-modules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]

0 comments on commit e00c252

Please sign in to comment.