Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NUglify instead of AjaxMin #343

Merged
merged 9 commits into from Sep 19, 2019
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO.Abstractions;
using System.IO;
using Microsoft.Ajax.Utilities;
using NUglify;
using Pretzel.Logic.Extensions;

namespace Pretzel.Logic.Minification
{
@@ -20,13 +21,16 @@ public JsMinifier(IFileSystem fileSystem, IEnumerable<FileInfo> files, string ou

public void Minify()
{
var minifer = new Minifier();
var codeSettings = new CodeSettings();

var content = fileSystem.BundleFiles(files);
var minified = minifer.MinifyJavaScript(content, codeSettings);

fileSystem.File.WriteAllText(outputPath, minified);
var minified = Uglify.Js(content);
if(minified.HasErrors)
{
foreach(var error in minified.Errors)
{
Tracing.Error(error.ToString());
}
}
fileSystem.File.WriteAllText(outputPath, minified.Code);
}
}
}
@@ -27,14 +27,14 @@
<DefineConstants>NETSTANDARD</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AjaxMin" Version="5.14.5506.26202" />
<PackageReference Include="CommonMark.NET" Version="0.15.1" />
<PackageReference Include="dotless.Core" Version="1.6.7" />
<PackageReference Include="DotLiquid" Version="2.0.314" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.12" />
<PackageReference Include="Microsoft.AspNet.Razor" Version="3.2.7" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="2.1.1" />
<PackageReference Include="NDesk.Options" Version="0.2.1" />
<PackageReference Include="NUglify" Version="1.5.13" />
<PackageReference Include="RazorEngine" Version="3.10.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="7.16.0.8981">
<PrivateAssets>all</PrivateAssets>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.