You can use the VS Code debugger while you run your project with the Netlify CLI. This document outlines how to configure VS Code and how to launch the debugger.
Create a launch.json
file under a .vscode
directory in your project with the following content.
{
"version": "0.2.0",
"configurations": [
{
"name": "netlify dev",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/.netlify/functions-serve/**/*.js"],
"program": "${workspaceFolder}/node_modules/.bin/netlify",
"args": ["dev"],
"console": "integratedTerminal",
"env": { "BROWSER": "none" },
"serverReadyAction": {
"pattern": "Server now ready on (https?://[\\w:.-]+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
},
{
"name": "netlify functions:serve",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/.netlify/functions-serve/**/*.js"],
"program": "${workspaceFolder}/node_modules/.bin/netlify",
"args": ["functions:serve"],
"console": "integratedTerminal"
}
]
}
After you create the configuration file, launch the debugger:
Run and Debug
from the VS Code sidebar. To reduce noise, we recommend that you deactivate Caught Exceptions
.netlify dev
or netlify functions:serve
If you select netlify dev
, the CLI will start a local development environment and open a browser with the site URL. If you select netlify functions:serve
, the CLI will start a standalone Netlify Functions server.
Use the --inspect
Node.js option to debug functions. Visit managing functions for more information.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4