File tree 4 files changed +28
-4
lines changed
4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ NYC.prototype.instrumenter = function () {
136
136
137
137
NYC . prototype . _createInstrumenter = function ( ) {
138
138
return this . _instrumenterLib ( this . cwd , {
139
- produceSourceMap : this . config . produceSourceMap
139
+ produceSourceMap : this . config . produceSourceMap ,
140
+ compact : this . config . compact ,
141
+ preserveComments : this . config . preserveComments
140
142
} )
141
143
}
142
144
Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ exports.builder = function (yargs) {
31
31
type : 'boolean' ,
32
32
description : "should nyc's instrumenter produce source maps?"
33
33
} )
34
+ . option ( 'compact' , {
35
+ default : true ,
36
+ type : 'boolean' ,
37
+ description : 'should the output be compacted?'
38
+ } )
39
+ . option ( 'preserve-comments' , {
40
+ default : true ,
41
+ type : 'boolean' ,
42
+ description : 'should comments be preserved in the output?'
43
+ } )
34
44
. option ( 'instrument' , {
35
45
default : true ,
36
46
type : 'boolean' ,
@@ -50,7 +60,9 @@ exports.handler = function (argv) {
50
60
sourceMap : argv . sourceMap ,
51
61
produceSourceMap : argv . produceSourceMap ,
52
62
extension : argv . extension ,
53
- require : argv . require
63
+ require : argv . require ,
64
+ compact : argv . compact ,
65
+ preserveComments : argv . preserveComments
54
66
} )
55
67
56
68
nyc . instrumentAllFiles ( argv . input , argv . output , function ( err ) {
Original file line number Diff line number Diff line change @@ -165,6 +165,16 @@ Config.buildYargs = function (cwd) {
165
165
description : "should nyc's instrumenter produce source maps?" ,
166
166
global : false
167
167
} )
168
+ . option ( 'compact' , {
169
+ default : true ,
170
+ type : 'boolean' ,
171
+ description : 'should the output be compacted?'
172
+ } )
173
+ . option ( 'preserve-comments' , {
174
+ default : true ,
175
+ type : 'boolean' ,
176
+ description : 'should comments be preserved in the output?'
177
+ } )
168
178
. option ( 'instrument' , {
169
179
default : true ,
170
180
type : 'boolean' ,
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ function InstrumenterIstanbul (cwd, options) {
9
9
autoWrap : true ,
10
10
coverageVariable : '__coverage__' ,
11
11
embedSource : true ,
12
- noCompact : false ,
13
- preserveComments : true ,
12
+ compact : options . compact ,
13
+ preserveComments : options . preserveComments ,
14
14
produceSourceMap : options . produceSourceMap ,
15
15
esModules : true
16
16
} )
You can’t perform that action at this time.
0 commit comments