mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
docs: add brief information on debugging a nuxt app (#20282)
This commit is contained in:
parent
8aa86559c8
commit
37e62e4ea1
65
docs/2.guide/3.going-further/9.debugging.md
Normal file
65
docs/2.guide/3.going-further/9.debugging.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
title: "Debugging"
|
||||||
|
description: "In Nuxt 3, you can get started with debugging your application directly in the browser as well as in your IDE."
|
||||||
|
---
|
||||||
|
|
||||||
|
## Sourcemaps
|
||||||
|
|
||||||
|
Sourcemaps are enabled for your server build by default, and for the client build in dev mode, but you can enable them more specifically in your configuration.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
export default defineNuxtConfig({
|
||||||
|
// or sourcemap: true
|
||||||
|
sourcemap: {
|
||||||
|
server: true,
|
||||||
|
client: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Debugging in Your IDE
|
||||||
|
|
||||||
|
It is possible to debug your Nuxt app in your IDE while you are developing it.
|
||||||
|
|
||||||
|
### Example VS Code Debug Configuration
|
||||||
|
|
||||||
|
You may need to update the config below with a path to your web browser. For more information, visit the [VS Code documentation about debug configuration](https://go.microsoft.com/fwlink/?linkid=830387).
|
||||||
|
|
||||||
|
```json5
|
||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "client: chrome",
|
||||||
|
"url": "http://localhost:3000",
|
||||||
|
"webRoot": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "server: nuxt",
|
||||||
|
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
|
||||||
|
"args": [
|
||||||
|
"dev"
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"compounds": [
|
||||||
|
{
|
||||||
|
"name": "fullstack: nuxt",
|
||||||
|
"configurations": [
|
||||||
|
"server: nuxt",
|
||||||
|
"client: chrome"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Other IDEs
|
||||||
|
|
||||||
|
If you have another IDE and would like to contribute sample configuration, feel free to [open a PR](https://github.com/nuxt/nuxt/edit/main/docs/2.guide/3.going-further/9.debugging.md)!
|
Loading…
Reference in New Issue
Block a user