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

Updated NUglify to the latest version/ Adding Ignore Error Flag #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BundlerMinifier.Core/BundlerMinifier.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUglify" Version="1.13.8" />
<PackageReference Include="NUglify" Version="1.20.7" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions src/BundlerMinifier.Core/Minify/JavaScriptOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public static CodeSettings GetSettings(Bundle bundle)
settings.PreserveImportantComments = GetValue(bundle, "preserveImportantComments", true) == "True";
settings.TermSemicolons = GetValue(bundle, "termSemicolons", true) == "True";

settings.IgnoreAllErrors = GetValue(bundle, "ignoreAllErrors", false) == "True";

if (GetValue(bundle, "renameLocals", true) == "False")
settings.LocalRenaming = LocalRenaming.KeepAll;

Expand Down
2 changes: 1 addition & 1 deletion src/BundlerMinifier/BundlerMinifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.Build.Framework" Version="15.1.0-*" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.1.0-*" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" PrivateAssets="All" />
<PackageReference Include="NUglify" Version="1.13.8" PrivateAssets="All" />
<PackageReference Include="NUglify" Version="1.20.7" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
Expand Down
1 change: 1 addition & 0 deletions src/BundlerMinifierTest/BundlerMinifierTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<ItemGroup>
<None Remove="artifacts\file5.js" />
<None Remove="artifacts\file6.js" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions src/BundlerMinifierTest/BundlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,14 @@ public void SupportDoubleAsteriskOperator()

Assert.AreEqual("function r(n,t){return n**t}let x=2**5.1,y=3**x,z=2**81,p=21;", jsResult);
}


[TestMethod]
public void SupportIngoreError()
{
_processor.Process(TEST_BUNDLE.Replace("test1", "test10"));
string jsResult = File.ReadAllText("../../../artifacts/test10.min.js");
Assert.AreEqual("function throw(n){throw new Error(n);}", jsResult);
}
}
}
3 changes: 3 additions & 0 deletions src/BundlerMinifierTest/artifacts/file6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function throw (str){
throw new Error(str);
}
11 changes: 11 additions & 0 deletions src/BundlerMinifierTest/artifacts/test10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"outputFileName": "test10.min.js",
"inputFiles": [
"file6.js"
],
"minify": {
"ignoreAllErrors": true
}
}
]
1 change: 1 addition & 0 deletions src/BundlerMinifierTest/artifacts/test10.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function throw(n){throw new Error(n);}
4 changes: 2 additions & 2 deletions src/BundlerMinifierVsix/BundlerMinifierVsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@
<HintPath>..\..\packages\NuGet.VisualStudio.3.5.0\lib\net45\NuGet.VisualStudio.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="NUglify, Version=1.13.8.0, Culture=neutral, PublicKeyToken=15bc7810aec21b5e, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUglify.1.13.8\lib\net40\NUglify.dll</HintPath>
<Reference Include="NUglify, Version=1.20.7.0, Culture=neutral, PublicKeyToken=15bc7810aec21b5e, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUglify.1.20.7\lib\net40\NUglify.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down
2 changes: 1 addition & 1 deletion src/BundlerMinifierVsix/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
<package id="NuGet.VisualStudio" version="3.5.0" targetFramework="net46" />
<package id="NUglify" version="1.13.8" targetFramework="net46" />
<package id="NUglify" version="1.20.7" targetFramework="net46" />
</packages>