From 6ef5ce7f2d7def376e037fe3bb1c4d2ab78a995b Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 13 Oct 2021 20:07:44 +0800 Subject: [PATCH] Check newline for min files. --- .../Volo/Abp/Cli/Bundling/BundlerBase.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs index e6bff3233c..9db9ced89e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs @@ -41,7 +41,7 @@ namespace Volo.Abp.Cli.Bundling return GenerateDefinition(bundleFilePath,fileDefinitionsExcludingFromBundle); } - private bool IsMinFile(string fileName) + private bool IsMinFile(string fileName, string content) { foreach (var suffix in _minFileSuffixes) { @@ -51,6 +51,11 @@ namespace Volo.Abp.Cli.Bundling } } + if (content.IndexOf(Environment.NewLine, StringComparison.Ordinal) < 10) + { + return true; + } + return false; } @@ -117,7 +122,7 @@ namespace Volo.Abp.Cli.Bundling private string GetFileContent(string filePath, bool minify) { var content = File.ReadAllText(filePath); - if (minify && !IsMinFile(filePath)) + if (minify && !IsMinFile(filePath, content)) { try {