-
启动:npm run dev(终端1运行,不关闭)---> npm start(终端2运行)。修改代码后,保存,会自动重新编译。
-
刷新页面:Ctrl+shift+R
-
调试:
-
页面:ctrl+shift+i,获取元素或设置断点调试
-
VScode中调试:配置launch.json,如下:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/main.js",
"protocol": "inspector" //添加默认的协议是legacy,这个协议导致不进入断点
},
]
}