debug-strapi-app-in-vscode

141 阅读1分钟
  1. add server.js to the root path of the project
#!/usr/bin/env node

'use strict';

// Start Strapi
const strapi = require('strapi');
strapi().start();
  1. set launch.json as the following(root path of strapi project):
{
    // 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": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${workspaceFolder}/server.js"
      },
  ]
}
  1. add a breakpoint to the row you want to debug, click the debug button, done!

see more here