|
|
|
@ -411,9 +411,34 @@ F:\Project\electron\web-designer-test |
|
|
|
mainWindow = new BrowserWindow({width: 900, height: 680, webPreferences: {nodeIntegration: true}}); |
|
|
|
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://www.codementor.io/randyfindley/how-to-build-an-electron-app-using-create-react-app-and-electron-builder-ss1k0sfer |
|
|
|
- https://juejin.im/post/5c356a396fb9a049e30848f0 |
|
|
|
- https://juejin.im/post/5c356a396fb9a049e30848f0 |