This can be collapsed into `if (env.config.nunjucks && env.config.nunjucks.filterdir) { ...`