diff --git a/src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj b/src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj index 40de8d43..e62f48db 100644 --- a/src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj +++ b/src/tools/BootstrapBlazor.CssBundler/BootstrapBlazor.CssBundler.csproj @@ -1,7 +1,7 @@  - 1.0.0 + 1.0.1 Exe net9.0 enable diff --git a/src/tools/BootstrapBlazor.CssBundler/Bundler.cs b/src/tools/BootstrapBlazor.CssBundler/Bundler.cs index 9e059b41..bece4236 100644 --- a/src/tools/BootstrapBlazor.CssBundler/Bundler.cs +++ b/src/tools/BootstrapBlazor.CssBundler/Bundler.cs @@ -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 @@ -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; @@ -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(); } writer.Close(); diff --git a/src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs b/src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs index 6a545a84..c8569952 100644 --- a/src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs +++ b/src/tools/BootstrapBlazor.CssBundler/BundlerOptions.cs @@ -13,10 +13,10 @@ sealed class BundlerOptions public List InputFiles { get; set; } = []; - public static BundlerOptions LoadFromConfigFile(string configFile) + public static List LoadFromConfigFile(string configFile) { var json = File.ReadAllText(configFile); - return JsonSerializer.Deserialize(json, JsonSerializerOptions.Web) ?? new(); + return JsonSerializer.Deserialize>(json, JsonSerializerOptions.Web) ?? new(); } }