Skip to content

Commit

Permalink
Merge pull request #19756 from abpframework/CLI-BundlingService
Browse files Browse the repository at this point in the history
Compatible with `app-nolayers`.
  • Loading branch information
oykuermann committed May 9, 2024
2 parents ac716a2 + 8d25ce4 commit 405cebd
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 405cebd

Please sign in to comment.