ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
753 stars 113 forks source link

Catch exceptions in js minifier and don't re-minify single files #221

Closed jehhynes closed 2 years ago

jehhynes commented 2 years ago
  1. Was running into an internal error in NUglify minifying a bundle which included signalr.js (cdnjs package "microsoft-signalr@6.0.1"). Strangely, in this package, signalr.js and signalr.min.js are both minified. Regardless, we should not just die when NUglify has internal errors. Instead, gracefully handle the exception and use the unminified version instead.
  2. Looks like there is code in place to skip reminifying bundles that are already minified, but not single files when bundling is disabled, so I added a check for .min.js, .min.css, .min.html in the corresponding minifier classes (in addition to the ".min" check)
madskristensen commented 2 years ago

Thanks