From bceba21f9b85010e7cffbad43e3adb81a9f5a183 Mon Sep 17 00:00:00 2001 From: lniwn Date: Tue, 30 Jul 2019 18:02:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ectron+React开发跨平台桌面应用.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/content/posts/2019/使用Electron+React开发跨平台桌面应用.md b/content/posts/2019/使用Electron+React开发跨平台桌面应用.md index 402f5d0..606bde1 100644 --- a/content/posts/2019/使用Electron+React开发跨平台桌面应用.md +++ b/content/posts/2019/使用Electron+React开发跨平台桌面应用.md @@ -411,9 +411,34 @@ F:\Project\electron\web-designer-test mainWindow = new BrowserWindow({width: 900, height: 680, webPreferences: {nodeIntegration: true}}); ``` + +- 使用VSCode进行主进程调试 + + 添加一个文件`.vscode/launch.json`在项目根目录,然后即可使用VSCode进行调试。 + + ```json + { + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Main Process", + "type": "node", + "request": "launch", + "cwd": "${workspaceRoot}", + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", + "windows": { + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" + }, + "args" : ["."], + "outputCapture": "std" + } + ] + } + ``` + -*参考文档* +参考文档* - https://www.codementor.io/randyfindley/how-to-build-an-electron-app-using-create-react-app-and-electron-builder-ss1k0sfer - https://juejin.im/post/5c356a396fb9a049e30848f0 \ No newline at end of file