diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..71e2acba --- /dev/null +++ b/.vscode/launch.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/src/main/app.js b/src/main/app.js index 32a37fe7..f7ed4e79 100644 --- a/src/main/app.js +++ b/src/main/app.js @@ -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))