Open1

VscodeでNuxt.jsのデバッグ

しみゆーしみゆー

Vscode上でNuxt.jsのデバッグを行いたかったが、breakpointが貼れない状態になってしまった。

その解消策。

参考

https://www.afterdigital.co.uk/insights-and-updates/debug-nuxt-with-vs-code

nuxt.config.js

  build: {
    extend(config, ctx) {
      if (ctx.isDev) {
        config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map'
      }
    },
  },

.vscode/launch.json

  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Nuxtjs: Launch Chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}"
    }
  ],
  // これを追加
  "compounds": [
    {
      "name": "fullstack: nuxt",
      "configurations": ["Nuxtjs: Launch Chrome"]
    }
  ]
}

結果