Eleventy: Possible to use VS Code debugger?

Created on 6 Dec 2018  路  3Comments  路  Source: 11ty/eleventy

What I want to do is console.log variables when I create shortcodes. Template fills up the console too much, so it's hard to debug.

Wondering whether it's possible to debug with VS code built in debugger. If yes, what's the configuration? If no, is there a better way to run a console.log? (Ideally, I'd want breakpoints).

Thanks so much!

education help-wanted

Most helpful comment

To debug 11ty using Visual Studio Code, you could use the following launch configuration:

{
    "type": "node",
    "request": "launch",
    "name": "Launch 11ty",
    "program": "${workspaceFolder}\\node_modules\\@11ty\\eleventy\\cmd.js",
    "args": [
        // Just an example argument
        // "--output=C:\\Temp"
    ],
}

All 3 comments

Oh鈥攎aybe! I haven鈥檛 used VS Code so I鈥檓 not sure. Anyone else?

(You may already be aware of this but don鈥檛 forget the --quiet command-line option to hide some of the default console output)

To debug 11ty using Visual Studio Code, you could use the following launch configuration:

{
    "type": "node",
    "request": "launch",
    "name": "Launch 11ty",
    "program": "${workspaceFolder}\\node_modules\\@11ty\\eleventy\\cmd.js",
    "args": [
        // Just an example argument
        // "--output=C:\\Temp"
    ],
}

Thanks @pamtbaau!

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem鈥攇reat! But if you鈥檙e still having problems, do not let the issue鈥檚 closing deter you if you have additional questions! Post another comment and I will reopen the issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings