Skip to content

Commit 5c6c234

Browse files
committed
feat: 支持多配置
1 parent 6a99902 commit 5c6c234

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/tools/BootstrapBlazor.CssBundler/Bundler.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5+
using System.Text;
6+
57
namespace BootstrapBlazor.CssBundler;
68

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

3133
static void BundlerCore(string bundlerFile)
3234
{
33-
var option = BundlerOptions.LoadFromConfigFile(bundlerFile);
35+
var options = BundlerOptions.LoadFromConfigFile(bundlerFile);
36+
37+
foreach (var option in options)
38+
{
39+
DoBundler(bundlerFile, option);
40+
}
41+
}
3442

43+
static void DoBundler(string bundlerFile, BundlerOptions option)
44+
{
3545
if (string.IsNullOrEmpty(option.OutputFileName))
3646
{
3747
return;
@@ -58,7 +68,8 @@ static void BundlerCore(string bundlerFile)
5868
}
5969

6070
using var reader = File.OpenText(inputFile);
61-
reader.BaseStream.CopyTo(writer);
71+
var content = reader.ReadToEnd();
72+
writer.Write(Encoding.UTF8.GetBytes(content));
6273
reader.Close();
6374
}
6475
writer.Close();

0 commit comments

Comments
 (0)