From cf80fb1a95646224b415e61b94863570fbd42a0a Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 28 Feb 2023 15:05:19 +0800 Subject: [PATCH] Fix bundle service path issue --- .../Volo/Abp/Cli/Bundling/BundlerBase.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 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 581cf9b8fc..e49e24d0ef 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 @@ -109,12 +109,19 @@ public abstract class BundlerBase : IBundler, ITransientDependency content = GetFileContent(filePath, options.Minify); } - content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"), + content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"), content); + + if (content.Contains("coding")) + { + + } + builder.AppendLine(content); } + return builder.ToString(); } } @@ -125,15 +132,15 @@ public abstract class BundlerBase : IBundler, ITransientDependency foreach (var definition in bundleDefinitions) { var filePath = Path.Combine(definition.Source.Split('/')); - + var fileFullPath = Directory.GetFiles(options.Directory, string.Empty, SearchOption.AllDirectories).FirstOrDefault(x => x.EndsWith(filePath)); if(fileFullPath == null) { throw new AbpException("Not found: " + definition.Source); } - + var content = GetFileContent(fileFullPath, options.Minify); - content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"), + content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"), content); builder.AppendLine(content);