From 150f5535bade291ddcc04b01aa914b3a2b78f9e8 Mon Sep 17 00:00:00 2001 From: Darrel O'Pry Date: Tue, 29 Sep 2020 16:44:24 -0400 Subject: [PATCH] Do not instrument production code modify the .babelrc to only apply istanbul instrumentation to development code NODE_ENV is set to development when running next and next dev next build set NODE_ENV to production --- .babelrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 55f3f85..20260de 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,9 @@ { "presets": ["next/babel"], - "plugins": ["istanbul"] + "env" : { + "development: { + // only instrument for coverage on development builds + "plugins": ["istanbul"] + } + } }