11ty / eleventy-plugin-directory-output

Group and sort Eleventy’s verbose output by directory (and show file size with benchmarks)
MIT License
20 stars 1 forks source link

Programmatic quietMode option not respected for directory output #6

Open webstackdev opened 1 year ago

webstackdev commented 1 year ago

I'm using the programmatic API in a test helper method to compile a single template, so that I can create a JSDOM object and attach a script to it for testing. The programmatic method allows passing an options object that can have a quietMode property, and it's helpful to suppress all output in my test runner.

However, this option isn't respected by the eleventy-plugin-directory-output module so I get a lot of extraneous output from my test runner. I think the right way to fix this would be something like this:

-    d.print();
+    if (!eleventyConfig.quietMode) d.print();

I thought I'd ask before submitting a PR if this is the best solution.

zachleat commented 1 year ago

Yeah, I’m happy to review a PR for the directory output plugin! Moving this one over there