Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 2.47 KB

debugging.md

File metadata and controls

58 lines (38 loc) · 2.47 KB
eleventyNavigation
parent key order
Getting Started
Debugging
3

Debugging

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

Mac OS (or Linux, etc)

What is the difference between Local and Global installation?

Installed Globally
{% highlight "bash" %}DEBUG=Eleventy* eleventy{% endhighlight %}
Installed Locally
{% highlight "bash" %}DEBUG=Eleventy* npx @11ty/eleventy{% endhighlight %}

Windows

What is the difference between Local and Global installation?

Installed Locally
{% highlight "bash" %}set DEBUG=Eleventy* & npx @11ty/eleventy{% endhighlight %}
Installed Globally
{% highlight "bash" %}set DEBUG=Eleventy* & eleventy{% endhighlight %}

Read more about Windows environment variables.

Learn More

Read more at the debug package documentation.

Try with --dryrun

{% addedin "0.3.0" %} Works great with --dryrun if you want to run Eleventy but not actually write any files.

View all messages

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=*.