feature: vscode debug config support (#446)

* feature: vscode debug config support

* improment vscode debug settings
This commit is contained in:
enyaxu 2018-08-12 16:08:48 +08:00 committed by Ran Luo
parent 486eb933b0
commit ab6e103983
2 changed files with 40 additions and 0 deletions

35
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,35 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Marktext: Main",
"program": "${workspaceFolder}/.electron-vue/dev-runner.js",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
}
},
{
"name": "Marktext: Renderer",
"type": "chrome",
"request": "attach",
"port": 8315,
"webRoot": "${workspaceFolder}/src",
"timeout": 30000,
"urlFilter": "localhost:*"
}
],
"compounds": [
{
"name": "Marktext: All",
"configurations": [
"Marktext: Main",
"Marktext: Renderer"
]
}
]
}

View File

@ -16,6 +16,11 @@ class App {
app.commandLine.appendSwitch('enable-experimental-web-platform-features', 'true')
}
// Enable vscode chrome extension debugger connection
if (process.env.NODE_ENV === 'development') {
app.commandLine.appendSwitch('remote-debugging-port', '8315')
}
app.on('open-file', this.openFile.bind(this))
app.on('ready', this.ready.bind(this))