2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 02:28:55 +00:00

Cleanup app files and directories

- All source files are now in `src` and will be compiled and copied over to `lib` on `npm run build-app`
- Add logging of `appArgs` in preload on startup
- Use node `path` module to resolve pathnames instead of concatenating strings together
This commit is contained in:
Jia Hao 2016-01-22 19:57:39 +08:00
parent c1f844f072
commit 5c204eec77
6 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,7 @@
var fs = require('fs');
var os = require('os');
var path = require('path');
var electron = require('electron');
var wurl = require('wurl');
@ -13,9 +14,9 @@ var BrowserWindow = electron.BrowserWindow;
var shell = electron.shell;
var ipcMain = electron.ipcMain;
var buildMenu = require('./buildMenu');
var buildMenu = require('./components/menu/menu');
const APP_ARGS_FILE_PATH = __dirname + '/nativefier.json';
const APP_ARGS_FILE_PATH = path.join(__dirname, '..', 'nativefier.json');
var mainWindow = null;
@ -57,7 +58,7 @@ app.on('ready', function () {
javascript: true,
plugins: true,
nodeIntegration: false,
preload: __dirname + '/assets/js/index.js'
preload: path.join(__dirname, 'preload.js')
}
}
);

View File

@ -1,5 +1,5 @@
/**
* Created by JiaHao on 5/7/15.
Preload file that will be executed in the renderer process
*/
var ipc = require('electron').ipcRenderer;
@ -10,4 +10,5 @@ document.addEventListener("DOMContentLoaded", function(event) {
ipc.on('params', function (event, message) {
var appArgs = JSON.parse(message);
console.log('nativefier.json', appArgs);
});