File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- // the babel cache does not play nicely with nyc.
4- process . env . BABEL_DISABLE_CACHE = '1'
5-
63var configUtil = require ( '../lib/config-util' )
74var foreground = require ( 'foreground-child' )
85var NYC
@@ -50,9 +47,15 @@ if (argv._[0] === 'report') {
5047 NYC_CONFIG : JSON . stringify ( config ) ,
5148 NYC_CWD : process . cwd ( ) ,
5249 NYC_ROOT_ID : nyc . rootId ,
53- BABEL_DISABLE_CACHE : 1 ,
5450 NYC_INSTRUMENTER : config . instrumenter
5551 }
52+
53+ if ( config [ 'babel-cache' ] === false ) {
54+ // babel's cache interferes with some configurations, so is
55+ // disabled by default. opt in by setting babel-cache=true.
56+ env . BABEL_DISABLE_CACHE = process . env . BABEL_DISABLE_CACHE = '1'
57+ }
58+
5659 sw ( [ wrapper ] , env )
5760
5861 // Both running the test script invocation and the check-coverage run may
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ Config.buildYargs = function (cwd) {
142142 type : 'boolean' ,
143143 describe : 'cache instrumentation results for improved performance'
144144 } )
145+ . option ( 'babel-cache' , {
146+ default : false ,
147+ type : 'boolean' ,
148+ describe : 'cache babel transpilation results for improved performance'
149+ } )
145150 . option ( 'extension' , {
146151 alias : 'e' ,
147152 default : [ ] ,
You can’t perform that action at this time.
0 commit comments