@@ -774,11 +774,8 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
774
774
return tags
775
775
}
776
776
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 )
782
779
const assetsBase = getBaseInHTML ( relativeUrlPath , config )
783
780
const toOutputFilePath = (
784
781
filename : string ,
@@ -804,7 +801,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
804
801
const toOutputPublicAssetFilePath = ( filename : string ) =>
805
802
toOutputFilePath ( filename , 'public' )
806
803
807
- const isAsync = isAsyncScriptMap . get ( config ) ! . get ( id ) !
804
+ const isAsync = isAsyncScriptMap . get ( config ) ! . get ( normalizedId ) !
808
805
809
806
let result = html
810
807
@@ -813,7 +810,8 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
813
810
( chunk ) =>
814
811
chunk . type === 'chunk' &&
815
812
chunk . isEntry &&
816
- chunk . facadeModuleId === id ,
813
+ chunk . facadeModuleId &&
814
+ normalizePath ( chunk . facadeModuleId ) === normalizedId ,
817
815
) as OutputChunk | undefined
818
816
819
817
let canInlineEntry = false
@@ -898,7 +896,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
898
896
[ ...normalHooks , ...postHooks ] ,
899
897
{
900
898
path : '/' + relativeUrlPath ,
901
- filename : id ,
899
+ filename : normalizedId ,
902
900
bundle,
903
901
chunk,
904
902
} ,
@@ -928,7 +926,9 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
928
926
inlineEntryChunk . add ( chunk . fileName )
929
927
}
930
928
931
- const shortEmitName = normalizePath ( path . relative ( config . root , id ) )
929
+ const shortEmitName = normalizePath (
930
+ path . relative ( config . root , normalizedId ) ,
931
+ )
932
932
this . emitFile ( {
933
933
type : 'asset' ,
934
934
fileName : shortEmitName ,
0 commit comments