@@ -199,13 +199,13 @@ export async function traverseHtml(
199199
200200export function getScriptInfo ( node : DefaultTreeAdapterMap [ 'element' ] ) : {
201201 src : Token . Attribute | undefined
202- sourceCodeLocation : Token . Location | undefined
202+ srcSourceCodeLocation : Token . Location | undefined
203203 isModule : boolean
204204 isAsync : boolean
205205 isIgnored : boolean
206206} {
207207 let src : Token . Attribute | undefined
208- let sourceCodeLocation : Token . Location | undefined
208+ let srcSourceCodeLocation : Token . Location | undefined
209209 let isModule = false
210210 let isAsync = false
211211 let isIgnored = false
@@ -214,7 +214,7 @@ export function getScriptInfo(node: DefaultTreeAdapterMap['element']): {
214214 if ( p . name === 'src' ) {
215215 if ( ! src ) {
216216 src = p
217- sourceCodeLocation = node . sourceCodeLocation ?. attrs ! [ 'src' ]
217+ srcSourceCodeLocation = node . sourceCodeLocation ?. attrs ! [ 'src' ]
218218 }
219219 } else if ( p . name === 'type' && p . value && p . value === 'module' ) {
220220 isModule = true
@@ -224,7 +224,7 @@ export function getScriptInfo(node: DefaultTreeAdapterMap['element']): {
224224 isIgnored = true
225225 }
226226 }
227- return { src, sourceCodeLocation , isModule, isAsync, isIgnored }
227+ return { src, srcSourceCodeLocation , isModule, isAsync, isIgnored }
228228}
229229
230230const attrValueStartRE = / = \s * ( .) /
@@ -447,7 +447,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
447447
448448 // script tags
449449 if ( node . nodeName === 'script' ) {
450- const { src, sourceCodeLocation , isModule, isAsync, isIgnored } =
450+ const { src, srcSourceCodeLocation , isModule, isAsync, isIgnored } =
451451 getScriptInfo ( node )
452452
453453 if ( isIgnored ) {
@@ -459,7 +459,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
459459 // referencing public dir url, prefix with base
460460 overwriteAttrValue (
461461 s ,
462- sourceCodeLocation ! ,
462+ srcSourceCodeLocation ! ,
463463 partialEncodeURIPath ( toOutputPublicFilePath ( url ) ) ,
464464 )
465465 }
0 commit comments