From 3fb54029d7dff8b66f48d6a50ce4ac92ed268373 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 13 Apr 2017 13:39:15 +0100 Subject: [PATCH] Fix packaged functionality Improve dependency management for Electron main process deps Dependencies in /electron/package.json will be installed through a script in /package.json and will be bundled via electron-builder Does not affect standard webapp whatsoever Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .gitignore | 1 + electron/package.json | 6 ++++++ package.json | 11 ++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 electron/package.json diff --git a/.gitignore b/.gitignore index c28df64c..86baa127 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /key.pem /lib /node_modules +/electron/node_modules /packages/ /webapp /.npmrc diff --git a/electron/package.json b/electron/package.json new file mode 100644 index 00000000..e6e7e2a4 --- /dev/null +++ b/electron/package.json @@ -0,0 +1,6 @@ +{ + "description": "Electron main process dependencies", + "dependencies": { + "electron-window-state": "^4.1.0" + } +} diff --git a/package.json b/package.json index 35ffb87b..dc1e3bea 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "build": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle", "build:dev": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle:dev", "dist": "scripts/package.sh", + "postinstall": "cd electron && npm i", "start:res": "node scripts/copy-res.js -w", "start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-file=bundles/_dev_/[name].js -w --progress", "start:js:prod": "NODE_ENV=production webpack-dev-server -w --progress", @@ -96,7 +97,6 @@ "css-raw-loader": "^0.1.1", "electron-builder": "^11.2.4", "electron-builder-squirrel-windows": "^11.2.1", - "electron-window-state": "^4.1.0", "emojione": "^2.2.7", "eslint": "^3.14.0", "eslint-config-google": "^0.7.1", @@ -145,6 +145,7 @@ "dereference": true, "//files": "We bundle everything, so we only need to include webapp/", "files": [ + "electron/node_modules/**", "electron/src/**", "electron/img/**", "webapp/**", @@ -159,10 +160,10 @@ }, "win": { "target": "squirrel" + }, + "directories": { + "buildResources": "electron/build", + "output": "electron/dist" } - }, - "directories": { - "buildResources": "electron/build", - "output": "electron/dist" } }