すぐ忘れるのでメモ
-
拡張機能より「Debugger for Chrome」をインストール
https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome -
.vscode/launch.jsonに以下を記述
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "Run npm start",
"command": "npm start",
"request": "launch",
"type": "node-terminal"
},
],
"compounds": [
{
"name": "Launch Chrome & npm start",
"configurations": [
"Launch Chrome",
"Run npm start"
]
}
]
}
- [Launch Chrome & npm start]をデバッグ実行