需要安裝最新版本的VS Code
和VS Code Chrome Debugger Extension
然後將下面的塊添加到您的launch.json
文件中,並將其放在.vscode
應用程序根目錄下的文件夾中。
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
然後先npm start
啓動項目,在使用vscode debug