diff --git a/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/IndexHtmlFileProvider.cs b/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/IndexHtmlFileProvider.cs index f9cc917462..dc81cfa9ef 100644 --- a/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/IndexHtmlFileProvider.cs +++ b/src/Microsoft.AspNetCore.Blazor.Build/Core/FileSystem/IndexHtmlFileProvider.cs @@ -147,7 +147,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Core.FileSystem var attributesDict = attributes.ToDictionary(x => x.Key, x => x.Value); attributesDict.Remove("type"); - attributesDict["src"] = "/_framework/blazor.js"; + attributesDict["src"] = "_framework/blazor.js"; attributesDict["main"] = assemblyNameWithExtension; attributesDict["entrypoint"] = assemblyEntryPoint; attributesDict["references"] = referencesAttribute; diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/IndexHtmlFileProviderTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/IndexHtmlFileProviderTest.cs index 3d5965097d..537e633ac9 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/IndexHtmlFileProviderTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/IndexHtmlFileProviderTest.cs @@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Blazor.Server.Test var parsedHtml = new HtmlParser().Parse("" + scriptTagText + ""); var scriptElem = parsedHtml.Body.QuerySelector("script"); Assert.False(scriptElem.HasChildNodes); - Assert.Equal("/_framework/blazor.js", scriptElem.GetAttribute("src")); + Assert.Equal("_framework/blazor.js", scriptElem.GetAttribute("src")); Assert.Equal("MyApp.Entrypoint.dll", scriptElem.GetAttribute("main")); Assert.Equal("MyNamespace.MyType::MyMethod", scriptElem.GetAttribute("entrypoint")); Assert.Equal("System.Abc.dll,MyApp.ClassLib.dll", scriptElem.GetAttribute("references"));