File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
- // the babel cache does not play nicely with nyc.
4
- process . env . BABEL_DISABLE_CACHE = '1'
5
-
6
3
var configUtil = require ( '../lib/config-util' )
7
4
var foreground = require ( 'foreground-child' )
8
5
var NYC
@@ -50,9 +47,15 @@ if (argv._[0] === 'report') {
50
47
NYC_CONFIG : JSON . stringify ( config ) ,
51
48
NYC_CWD : process . cwd ( ) ,
52
49
NYC_ROOT_ID : nyc . rootId ,
53
- BABEL_DISABLE_CACHE : 1 ,
54
50
NYC_INSTRUMENTER : config . instrumenter
55
51
}
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
+
56
59
sw ( [ wrapper ] , env )
57
60
58
61
// 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) {
142
142
type : 'boolean' ,
143
143
describe : 'cache instrumentation results for improved performance'
144
144
} )
145
+ . option ( 'babel-cache' , {
146
+ default : false ,
147
+ type : 'boolean' ,
148
+ describe : 'cache babel transpilation results for improved performance'
149
+ } )
145
150
. option ( 'extension' , {
146
151
alias : 'e' ,
147
152
default : [ ] ,
You can’t perform that action at this time.
0 commit comments