Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.58 KB

ignores.md

File metadata and controls

39 lines (27 loc) · 1.58 KB
eleventyNavigation
parent key order
Configuration
Ignore Files
2

Ignore Template Files

Add an .eleventyignore file to your input directory (or your project root {% addedin "0.7.0", "span", "minilink-inline" %}) for a new line-separated list of files (or globs) that will not be processed by Eleventy. Paths listed in your project’s .gitignore file are automatically ignored.

Example

{% codetitle ".eleventyignore" %}

README.md
_drafts/
secretNunjucksTemplates/anotherFolder/**/*.njk

node_modules Exemption

If you do not have a .gitignore file in your project, the node_modules directory will be ignored automatically. This makes new Eleventy projects a little easier and helps developers new to Eleventy get ramped up easier too.

{% callout "info" %}{% addedin "0.9.0" %}If .gitignore exists but is empty: if you have a .gitignore file and it is empty (or only contains white-space), node_modules will be ignored automatically.{% endcallout %}

Opt-out of using .gitignore {% addedin "0.3.5" %}

You can disable automatic use of your .gitignore file by using the Configuration API method: eleventyConfig.setUseGitIgnore(false);.

{% codetitle ".eleventy.js" %}

module.exports = function(eleventyConfig) {
    eleventyConfig.setUseGitIgnore(false);
};

When using .gitignore is disabled, .eleventyignore will be the single source of truth for ignored files. This also means that your node_modules directory will be processed unless otherwise specified in your .eleventyignore file.