File tree 4 files changed +8
-8
lines changed
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export function createCompilerCreator (baseCompile: Function): Function {
19
19
}
20
20
21
21
if ( options ) {
22
- if ( options . outputSourceRange ) {
22
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
23
23
// $flow-disable-line
24
24
const leadingSpaceLength = template . match ( / ^ \s * / ) [ 0 ] . length
25
25
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ export function parseHTML (html, options) {
245
245
name : args [ 1 ] ,
246
246
value : decodeAttr ( value , shouldDecodeNewlines )
247
247
}
248
- if ( options . outputSourceRange ) {
248
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
249
249
attrs [ i ] . start = args . start + args [ 0 ] . match ( / ^ \s * / ) . length
250
250
attrs [ i ] . end = args . end
251
251
}
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ export function parse (
127
127
element . ns = ns
128
128
}
129
129
130
- if ( options . outputSourceRange ) {
130
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
131
131
element . start = start
132
132
element . rawAttrsMap = element . attrsList . reduce ( ( cumulated , attr ) => {
133
133
cumulated [ attr . name ] = attr
@@ -244,7 +244,7 @@ export function parse (
244
244
// pop stack
245
245
stack . length -= 1
246
246
currentParent = stack [ stack . length - 1 ]
247
- if ( options . outputSourceRange ) {
247
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
248
248
element . end = end
249
249
}
250
250
endPre ( element )
@@ -296,7 +296,7 @@ export function parse (
296
296
}
297
297
}
298
298
if ( child ) {
299
- if ( options . outputSourceRange ) {
299
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
300
300
child . start = start
301
301
child . end = end
302
302
}
@@ -310,7 +310,7 @@ export function parse (
310
310
text,
311
311
isComment : true
312
312
}
313
- if ( options . outputSourceRange ) {
313
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
314
314
child . start = start
315
315
child . end = end
316
316
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export function parseComponent (
29
29
sfc . errors . push ( msg )
30
30
}
31
31
32
- if ( options . outputSourceRange ) {
32
+ if ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) {
33
33
warn = ( msg , range ) => {
34
34
const data : WarningMessage = { msg }
35
35
if ( range . start != null ) {
@@ -99,7 +99,7 @@ export function parseComponent (
99
99
currentBlock . end = start
100
100
currentBlock . blockEnd = end
101
101
let text = content . slice ( currentBlock . start , currentBlock . end )
102
- if ( ! options . outputSourceRange && ! options . disableDeindent ) {
102
+ if ( ! ( process . env . NODE_ENV !== 'production' && options . outputSourceRange ) && ! options . disableDeindent ) {
103
103
text = deindent ( text )
104
104
}
105
105
// pad content so that linters and pre-processors can output correct
You can’t perform that action at this time.
0 commit comments