File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,19 @@ export async function transformMain(
196196
197197 let resolvedMap : RawSourceMap | undefined = undefined
198198 if ( options . sourceMap ) {
199- if ( scriptMap && templateMap ) {
199+ if ( templateMap ) {
200200 // if the template is inlined into the main module (indicated by the presence
201201 // of templateMap), we need to concatenate the two source maps.
202-
202+ const from = scriptMap ?? {
203+ version : 3 ,
204+ sources : [ ] ,
205+ names : [ ] ,
206+ mappings : '' ,
207+ }
203208 const gen = fromMap (
204209 // version property of result.map is declared as string
205210 // but actually it is `3`
206- scriptMap as Omit < RawSourceMap , 'version' > as TraceEncodedSourceMap ,
211+ from as Omit < RawSourceMap , 'version' > as TraceEncodedSourceMap ,
207212 )
208213 const tracer = new TraceMap (
209214 // same above
@@ -231,8 +236,7 @@ export async function transformMain(
231236 // of the main module compile result, which has outdated sourcesContent.
232237 resolvedMap . sourcesContent = templateMap . sourcesContent
233238 } else {
234- // if one of `scriptMap` and `templateMap` is empty, use the other one
235- resolvedMap = scriptMap ?? templateMap
239+ resolvedMap = scriptMap
236240 }
237241 }
238242
You can’t perform that action at this time.
0 commit comments