@@ -144,9 +144,9 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
144144 const descriptor = getDescriptor ( query . filename )
145145 const hasScoped = descriptor . styles . some ( ( s ) => s . scoped )
146146 if ( query . src ) {
147- this . addWatchFile ( query . filename ) ;
147+ this . addWatchFile ( query . filename )
148148 }
149-
149+
150150 if ( query . type === 'template' ) {
151151 debug ( `transform(${ id } )` )
152152 const block = descriptor . template !
@@ -478,7 +478,7 @@ function getTemplateCode(
478478 const idQuery = `&id=${ id } `
479479 const scopedQuery = hasScoped ? `&scoped=true` : ``
480480 const srcQuery = descriptor . template . src ? `&src` : ``
481- const attrsQuery = attrsToQuery ( descriptor . template . attrs )
481+ const attrsQuery = attrsToQuery ( descriptor . template . attrs , 'js' , true )
482482 const query = `?vue&type=template${ idQuery } ${ srcQuery } ${ scopedQuery } ${ attrsQuery } `
483483 templateRequest = _ ( src + query )
484484 templateImport = `import { ${ renderFnName } } from ${ templateRequest } `
@@ -638,12 +638,15 @@ function _(any: any) {
638638 return JSON . stringify ( any )
639639}
640640
641- function normalizeSourceMap ( map : SFCTemplateCompileResults [ 'map' ] , id : string ) : any {
641+ function normalizeSourceMap (
642+ map : SFCTemplateCompileResults [ 'map' ] ,
643+ id : string
644+ ) : any {
642645 if ( ! map ) return null as any
643646
644647 if ( ! id . includes ( 'type=script' ) ) {
645- map . file = id ;
646- map . sources [ 0 ] = id ;
648+ map . file = id
649+ map . sources [ 0 ] = id
647650 }
648651
649652 return {
0 commit comments