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>
This commit is contained in:
Michael Telatynski 2017-04-13 13:39:15 +01:00
parent 76008e8abd
commit 3fb54029d7
3 changed files with 13 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
/key.pem /key.pem
/lib /lib
/node_modules /node_modules
/electron/node_modules
/packages/ /packages/
/webapp /webapp
/.npmrc /.npmrc

6
electron/package.json Normal file
View File

@ -0,0 +1,6 @@
{
"description": "Electron main process dependencies",
"dependencies": {
"electron-window-state": "^4.1.0"
}
}

View File

@ -36,6 +36,7 @@
"build": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle", "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", "build:dev": "node scripts/babelcheck.js && npm run build:res && npm run build:bundle:dev",
"dist": "scripts/package.sh", "dist": "scripts/package.sh",
"postinstall": "cd electron && npm i",
"start:res": "node scripts/copy-res.js -w", "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": "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", "start:js:prod": "NODE_ENV=production webpack-dev-server -w --progress",
@ -96,7 +97,6 @@
"css-raw-loader": "^0.1.1", "css-raw-loader": "^0.1.1",
"electron-builder": "^11.2.4", "electron-builder": "^11.2.4",
"electron-builder-squirrel-windows": "^11.2.1", "electron-builder-squirrel-windows": "^11.2.1",
"electron-window-state": "^4.1.0",
"emojione": "^2.2.7", "emojione": "^2.2.7",
"eslint": "^3.14.0", "eslint": "^3.14.0",
"eslint-config-google": "^0.7.1", "eslint-config-google": "^0.7.1",
@ -145,6 +145,7 @@
"dereference": true, "dereference": true,
"//files": "We bundle everything, so we only need to include webapp/", "//files": "We bundle everything, so we only need to include webapp/",
"files": [ "files": [
"electron/node_modules/**",
"electron/src/**", "electron/src/**",
"electron/img/**", "electron/img/**",
"webapp/**", "webapp/**",
@ -159,10 +160,10 @@
}, },
"win": { "win": {
"target": "squirrel" "target": "squirrel"
}
}, },
"directories": { "directories": {
"buildResources": "electron/build", "buildResources": "electron/build",
"output": "electron/dist" "output": "electron/dist"
} }
}
} }