Cześć , mam problem z poprawną konfiguracją VSCoda + Chrome Debugger + LiveServer.
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"preLaunchTask": "npmStart",
"name": "Launch Chrome against localhost",
"url": "http://localhost:5050/",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"breakOnLoad": true,
"sourceMapPathOverrides": {
"/*": "${webRoot}\\*"
},
"trace":true,
}
]
}
task.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{ "label": "npmStart",
"type": "npm",
"script": "build",
"isBackground": true,
"problemMatcher": [
{
"owner": "custom",
"pattern": {
"regexp": "^(.*)$"
},
"background": {
"activeOnStart": true,
"beginsPattern": "^(.*)$",
"endsPattern": "^Compiled successfully.(.*)$"
}
}
],
}
]
}
pliki poprawnie się transpilują, tworzą się pliki main.js, main.map.js, strona poprawnie się uruchamia niestety nie zatrzymuje sie w breakpoincie, w przegladarce poprawnie rozpoznaje sourceMapy, niestety nie w VScode,
Live server jest extension do Vscoda, działa na localhoscie:5050:/,
dodatkowo w setting:
"liveServer.settings.root": "build/"
cała aplikacja została stworzona przez
create-react-app my-app --scripts-version=react-scripts-ts
Jeżeli będzie ktoś zainteresowany to wrzuce na gita.
Pozdrawiam