Debug Mode Jump to heading
Having trouble? Want to see what Eleventy is doing behind the scenes? Use DEBUG
mode. We’re taking advantage of the excellent debug
package for this.
debug
will tell you exactly what directories Eleventy is using for data, includes, input, and output. It’ll tell you what search globs it uses to find your templates and what templates it finds. If you’re having trouble, enable this.
This makes use of something called Environment variables to enable, specifically the DEBUG
environment variable. In this case we’re just putting some text before the command we use to run Eleventy.
Commands Jump to heading
Mac OS (or Linux, etc) Jump to heading
What is the difference between Local and Global installation?
DEBUG=Eleventy* eleventy
DEBUG=Eleventy* npx @11ty/eleventy
Windows Jump to heading
Read more about Windows environment variables.
cmd.exe Jump to heading
What is the difference between Local and Global installation?
set DEBUG=Eleventy* & npx @11ty/eleventy
set DEBUG=Eleventy* & eleventy
Powershell (VS Code default) Jump to heading
What is the difference between Local and Global installation?
$env:DEBUG="Eleventy*"; npx @11ty/eleventy
$env:DEBUG="Eleventy*"; eleventy
Learn More Jump to heading
Read more at the debug
package documentation.
Try with --dryrun
Jump to heading
Works great with --dryrun
if you want to run Eleventy but not actually write any files.
View all messages Jump to heading
The commands above limit the messages from debug
to Eleventy specific things with DEBUG=Eleventy*
but you can view all of the messages from any dependency with DEBUG=*
.
Analyze Performance Jump to heading
New in v0.11.0 Read more about how to use debug
to analyze the performance of your Eleventy build.
Debug individual variables Jump to heading
New in v0.11.0 In addition to using debug
, you can use the global filter log
to console.log
anything from inside a template file.