From 79788efd1b5259e0b1f10f74861b20de960a37e7 Mon Sep 17 00:00:00 2001 From: Stuart Harrison Date: Wed, 15 Feb 2023 06:28:05 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#63968=20[Nunjucks]?= =?UTF-8?q?=20Add=20`dev`=20argument=20to=20`ConfigureOptions`=20by=20@pez?= =?UTF-8?q?holio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is an undocumented `dev` argument that can be sent to `nunjucks.configure`, which allows a full error trace to the thrown (See: https://github.com/mozilla/nunjucks/issues/1430) --- types/nunjucks/index.d.ts | 1 + types/nunjucks/nunjucks-tests.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/nunjucks/index.d.ts b/types/nunjucks/index.d.ts index 293b3612ec23ec..c6ad5e8195b507 100644 --- a/types/nunjucks/index.d.ts +++ b/types/nunjucks/index.d.ts @@ -44,6 +44,7 @@ export interface ConfigureOptions { lstripBlocks?: boolean | undefined; watch?: boolean | undefined; noCache?: boolean | undefined; + dev?: boolean | undefined; web?: | { useCache?: boolean | undefined; diff --git a/types/nunjucks/nunjucks-tests.ts b/types/nunjucks/nunjucks-tests.ts index f0e377ccce16e3..1d1393c1fe1023 100644 --- a/types/nunjucks/nunjucks-tests.ts +++ b/types/nunjucks/nunjucks-tests.ts @@ -30,6 +30,7 @@ nunjucks.configure('views', { autoescape: true, watch: true, }); +nunjucks.configure({ dev: true }); rendered = env.renderString(src, ctx); env.on('load', (name, source, loader) => {}); @@ -40,6 +41,7 @@ let extension: nunjucks.Extension = { return 'The parser api is complicated'; }, }; + env = env.addExtension('SpawnGlitter', extension); const hasExtension: boolean = env.hasExtension('SpawnGlitter'); extension = env.getExtension('SpawnGlitter');