Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
15 changes: 13 additions & 2 deletions src/tools/BootstrapBlazor.CssBundler/Bundler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

using System.Text;

namespace BootstrapBlazor.CssBundler;

internal class Bundler
Expand Down Expand Up @@ -30,8 +32,16 @@ public static void Run(string[] args)

static void BundlerCore(string bundlerFile)
{
var option = BundlerOptions.LoadFromConfigFile(bundlerFile);
var options = BundlerOptions.LoadFromConfigFile(bundlerFile);

foreach (var option in options)
{
DoBundler(bundlerFile, option);
}
}

static void DoBundler(string bundlerFile, BundlerOptions option)
{
if (string.IsNullOrEmpty(option.OutputFileName))
{
return;
Expand All @@ -58,7 +68,8 @@ static void BundlerCore(string bundlerFile)
}

using var reader = File.OpenText(inputFile);
reader.BaseStream.CopyTo(writer);
var content = reader.ReadToEnd();
writer.Write(Encoding.UTF8.GetBytes(content));
reader.Close();
Comment thread
ArgoZhang marked this conversation as resolved.
}
writer.Close();
Expand Down
4 changes: 2 additions & 2 deletions src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ sealed class BundlerOptions

public List<string> InputFiles { get; set; } = [];

public static BundlerOptions LoadFromConfigFile(string configFile)
public static List<BundlerOptions> LoadFromConfigFile(string configFile)
{
var json = File.ReadAllText(configFile);

return JsonSerializer.Deserialize<BundlerOptions>(json, JsonSerializerOptions.Web) ?? new();
return JsonSerializer.Deserialize<List<BundlerOptions>>(json, JsonSerializerOptions.Web) ?? new();
}
}