electron-forge / electron-forge-docs

:electron: Mirror for Electron Forge's GitBook documentation
https://electronforge.io
87 stars 150 forks source link

template=vite how debug #198

Open an78mK89fy opened 1 month ago

an78mK89fy commented 1 month ago
{
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Electron Main",
      "runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.sh",
      "windows": {
        "runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.cmd"
      },
      // runtimeArgs will be passed directly to your Electron application
      "runtimeArgs": [
        "foo",
        "bar"
      ],
      "cwd": "${workspaceFolder}",
      "console": "integratedTerminal"
    }
  ]
}

This content of the official website is only valid if you don't use the build tool, if you use the template of vite, it prompts that it is not bound, and you can't find the relevant instructions on the official website of forge and vite, who can help me.


vscode tip:

✅ This breakpoint was initially set in:

C:\Users\**\Documents\_Visual Studio Code\demo\src\main.js line 7 column 1

❓ We couldn't find a corresponding source location, but found some other files with the same name:

c:/Users/**/Documents/_Visual Studio Code/demo/src/node_modules/esbuild/lib/main.js
If this is the same file, you may need to adjust your build tool to correct the paths.