Skip to content

Commit

Permalink
Support debug of main process in VS Code
Browse files Browse the repository at this point in the history
  • Loading branch information
mflorence99 committed Jul 31, 2018
1 parent 2f426cf commit 4275e34
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron Main",
"env": { "DEV_MODE": "1" },
"preLaunchTask": "build-main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": [
"--nolazy",
"--ignore-gpu-blacklist"
],
"program": "${workspaceFolder}/dist/electron.js",
"protocol": "inspector"
}
]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build-main",
"type": "npm",
"script": "build-main",
"problemMatcher": [
"$tsc"
]
}
]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
"appId": "elfile"
},
"scripts": {
"build": "rimraf dist && ng build --aot && tsc -p tsconfig.main.json",
"build": "rimraf dist && ng build --aot && npm run build-main",
"build-main": "tsc -p tsconfig.main.json",
"clean": "rm -rf node_modules && rm package-lock.json && npm install",
"deb64": "electron-installer-debian --src build/elfile-linux-x64/ --arch amd64 --config installer.json",
"deb64-install": "sudo apt install ./build/installers/elfile_1.0.0_amd64.deb",
"live": "npm run build && electron . --ignore-gpu-blacklist",
"package": "npm run build && rimraf build && electron-packager ./ --out=build",
"postinstall": "npm rebuild sass && ./node_modules/.bin/electron-rebuild",
"serve": "ng serve",
"test": "tsc -p tsconfig.main.json && DEV_MODE=1 electron . --ignore-gpu-blacklist",
"test": "npm run build-main && DEV_MODE=1 electron . --ignore-gpu-blacklist",
"toc": "markdown-toc -i README.md"
},
"dependencies": {
Expand Down
12 changes: 10 additions & 2 deletions tsconfig.main.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"compilerOptions": {
"declaration": true,
"lib": ["dom", "es2016"],
"inlineSourceMap": true,
"inlineSources": true,
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"outDir": "./dist",
"removeComments": true,
"rootDir": "./main",
"strictNullChecks": false,
"target": "es2016"
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": [
"main/**/*"
Expand Down

0 comments on commit 4275e34

Please sign in to comment.