由于 Visual Studio Code 是使用 Electron 创建的,我猜可能将 launch.json 配置为使用 Electron 正确启动应用程序。但我还没想好怎么做。
另外,由于 Electron 基于 io.js,它本身基于 Node.js,我想也许……可以做到,但还没有找到神奇之处。
尝试了这些方面的东西......来自launch.json的片段:
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Launch Electron",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Workspace relative or absolute path to the program.
"program": "Y:\\dev\\electron\\electron.exe",
// Automatically stop program after launch.
"stopOnEntry": false,
// Command line arguments passed to the program.
"args": ["CrawlSpace_Electron\\"],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": ".",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": null,
// Environment variables passed to the program.
"env": { }
},
它确实启动了 Electron,但失败了(窗口消失得太快,无法确切了解原因)。
有什么想法吗?