Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatible with app-nolayers. #19756

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ public async Task BundleAsync(string directory, bool forceBuild, string projectT
if (!bundleConfig.InteractiveAuto)
{
var fileName = bundleConfig.IsBlazorWebApp
? Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Client", ""), "App.razor", SearchOption.AllDirectories).FirstOrDefault()
? Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Client", ""), "App.razor", SearchOption.AllDirectories).FirstOrDefault() ??
Directory.GetFiles(Path.GetDirectoryName(projectFilePath)!.Replace(".Blazor", ".Host"), "App.razor", SearchOption.AllDirectories).FirstOrDefault()
: Path.Combine(PathHelper.GetWwwRootPath(directory), "index.html");

if (fileName == null)
{
throw new BundlingException($"App.razor file could not be found in the {projectFilePath} directory.");
}

await UpdateDependenciesInBlazorFileAsync(fileName, styleDefinitions, scriptDefinitions);

Logger.LogInformation($"Script and style references in the {fileName} file have been updated.");
Expand Down