@@ -774,11 +774,8 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
774774 return tags
775775 }
776776
777- for ( const [ id , html ] of processedHtml ) {
778- const relativeUrlPath = path . posix . relative (
779- config . root ,
780- normalizePath ( id ) ,
781- )
777+ for ( const [ normalizedId , html ] of processedHtml ) {
778+ const relativeUrlPath = path . posix . relative ( config . root , normalizedId )
782779 const assetsBase = getBaseInHTML ( relativeUrlPath , config )
783780 const toOutputFilePath = (
784781 filename : string ,
@@ -804,7 +801,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
804801 const toOutputPublicAssetFilePath = ( filename : string ) =>
805802 toOutputFilePath ( filename , 'public' )
806803
807- const isAsync = isAsyncScriptMap . get ( config ) ! . get ( id ) !
804+ const isAsync = isAsyncScriptMap . get ( config ) ! . get ( normalizedId ) !
808805
809806 let result = html
810807
@@ -813,7 +810,8 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
813810 ( chunk ) =>
814811 chunk . type === 'chunk' &&
815812 chunk . isEntry &&
816- chunk . facadeModuleId === id ,
813+ chunk . facadeModuleId &&
814+ normalizePath ( chunk . facadeModuleId ) === normalizedId ,
817815 ) as OutputChunk | undefined
818816
819817 let canInlineEntry = false
@@ -898,7 +896,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
898896 [ ...normalHooks , ...postHooks ] ,
899897 {
900898 path : '/' + relativeUrlPath ,
901- filename : id ,
899+ filename : normalizedId ,
902900 bundle,
903901 chunk,
904902 } ,
@@ -928,7 +926,9 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
928926 inlineEntryChunk . add ( chunk . fileName )
929927 }
930928
931- const shortEmitName = normalizePath ( path . relative ( config . root , id ) )
929+ const shortEmitName = normalizePath (
930+ path . relative ( config . root , normalizedId ) ,
931+ )
932932 this . emitFile ( {
933933 type : 'asset' ,
934934 fileName : shortEmitName ,
0 commit comments