Skip to content

Commit

Permalink
Changes for Windows compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehlee committed Apr 29, 2019
1 parent fba4dde commit b5c32d9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
3 changes: 3 additions & 0 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var BrowserWindow = electron.BrowserWindow;
var mainWindow;
app.on('ready', function () {
mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true
},
width: 1024,
height: 768,
icon: path.join(__dirname, 'contents/img/[email protected]')
Expand Down
7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const spawn = require('child_process').spawn;
//const spawn = require('child_process').spawn;
const spawn = require('cross-spawn');
const gulp = require('gulp');
const babel = require('gulp-babel');
const css = require('gulp-css');
const path = require('path');
// 1. Copy the index.html as is
gulp.task('html', () => {
return gulp.src('src/index.html')
Expand All @@ -22,7 +24,8 @@ gulp.task('js', () => { // 3.
});
// 4. Start the electron process.

const cmd = (name) => `./node_modules/.bin/${name}`;
const cmd = (name) => path.join(__dirname + `/node_modules/.bin/${name}`);
//const cmd = (name) => name;
const args = (more) => Array.isArray(more) ? ['.'].concat(more) : ['.'];
const exit = () => process.exit();

Expand Down
35 changes: 14 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"electron": "^4.1.4",
"electron": "^5.0.0",
"electron-rebuild": "^1.8.4",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
Expand All @@ -37,7 +37,9 @@
},
"dependencies": {
"bootstrap": "^4.3.1",
"cross-spawn": "^6.0.5",
"jquery": "^3.4.0",
"node-abi": "^2.8.0",
"popper.js": "^1.15.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var mainWindow;

app.on('ready', function() {

mainWindow = new BrowserWindow({width: 1024, height: 768, icon: path.join(__dirname, 'contents/img/[email protected]')});
mainWindow = new BrowserWindow({webPreferences:{nodeIntegration: true}, width: 1024, height: 768, icon: path.join(__dirname, 'contents/img/[email protected]')});

mainWindow.loadURL(url.format({pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true } ));

Expand Down

0 comments on commit b5c32d9

Please sign in to comment.