Exclude node_modules by default

If no 'exclude' directive is specified, exclude node_modules by default.

https://twitter.com/mxstbr/status/761856359579185153
This commit is contained in:
Parker Moore 2016-08-07 12:15:58 -07:00
parent 562ffe7a3f
commit b8f17b9034
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
3 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,7 @@ module Jekyll
# Handling Reading
"safe" => false,
"include" => [".htaccess"],
"exclude" => ["vendor"],
"exclude" => %w(node_modules vendor),
"keep_files" => [".git", ".svn"],
"encoding" => "utf-8",
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",

View File

@ -594,7 +594,7 @@ collections:
# Handling Reading
safe: false
include: [".htaccess"]
exclude: ["vendor"]
exclude: ["node_modules", "vendor"]
keep_files: [".git", ".svn"]
encoding: "utf-8"
markdown_ext: "markdown,mkdown,mkdn,mkd,md"

View File

@ -48,6 +48,12 @@ class TestConfiguration < JekyllUnitTest
end
end
context "the defaults" do
should "exclude node_modules" do
assert_includes Configuration.from({})["exclude"], "node_modules"
end
end
context "#add_default_collections" do
should "no-op if collections is nil" do
result = Configuration[{ "collections" => nil }].add_default_collections