File tree Expand file tree Collapse file tree
src/tools/BootstrapBlazor.CssBundler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <Version >1.0.0 </Version >
4+ <Version >1.0.1 </Version >
55 <OutputType >Exe</OutputType >
66 <TargetFramework >net9.0</TargetFramework >
77 <ImplicitUsings >enable</ImplicitUsings >
Original file line number Diff line number Diff line change 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+
57namespace BootstrapBlazor . CssBundler ;
68
79internal 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 ( ) ;
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ sealed class BundlerOptions
1313
1414 public List < string > InputFiles { get ; set ; } = [ ] ;
1515
16- public static BundlerOptions LoadFromConfigFile ( string configFile )
16+ public static List < BundlerOptions > LoadFromConfigFile ( string configFile )
1717 {
1818 var json = File . ReadAllText ( configFile ) ;
1919
20- return JsonSerializer . Deserialize < BundlerOptions > ( json , JsonSerializerOptions . Web ) ?? new ( ) ;
20+ return JsonSerializer . Deserialize < List < BundlerOptions > > ( json , JsonSerializerOptions . Web ) ?? new ( ) ;
2121 }
2222}
You can’t perform that action at this time.
0 commit comments