Skip to content

Instantly share code, notes, and snippets.

@tanish-kr
Last active March 6, 2023 08:19
Show Gist options
  • Save tanish-kr/880c45c298af2eeb9bd80fd4e1222375 to your computer and use it in GitHub Desktop.
Save tanish-kr/880c45c298af2eeb9bd80fd4e1222375 to your computer and use it in GitHub Desktop.
VSCodeのブラウザデバッグ設定

VSCodeのReactブラウザデバッグ設定

Webpackを利用している場合

Chrome

  • Debbuger for Chromeをインストールする

Debbuger for Chromeは非推奨になっており、Javascript for Debuggerを利用すること

  • --incognito : シークレットモードで起動
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:3000",
      "runtimeArgs": [
        "--incognito"
      ],
      "webRoot": "${workspaceFolder}/frontend",
      "sourceMapPathOverrides": {
        "webpack:///./*": "${webRoot}/*",
        "webpack:///src/*": "${webRoot}/*",
        "webpack:///*": "*",
        "webpack:///./~/*": "${webRoot}/node_modules/*",
        "meteor://💻app/*": "${webRoot}/*"
      }
    }
  ]
}

Firefox

  • Debugger for Firefoxをインストールする
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "firefox",
      "request": "launch",
      "name": "Launch Firefox against localhost",
      "url": "http://localhost:3000",
      "reAttach": true,
      "firefoxArgs": [
        "-private"
      ],
      "webRoot": "${workspaceFolder}/frontend",
      "pathMappings": [
        { "url": "webpack:///./*", "path": "${webRoot}/*" },
        { "url": "webpack:///src/*", "path": "${webRoot}/*" },
        { "url": "webpack:///*", "path": "*" },
        { "url": "webpack:///./~/*", "path": "${webRoot}/node_modules/*" },
        { "url": "meteor://💻app/*", "path": "${webRoot}/*" }
      ]
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment