Repository navigation
Since 5.0.0 made NUglify the default minifier, any file NUglify can't parse fails the whole bundle request, and the error didn't tell you which file it was. This release makes that a lot friendlier and adds a simple way to turn minification off.
What's changed
- NUglify errors no longer fail the bundle by default (#236). If NUglify reports errors for a file, Smidge now logs a warning and serves that file unminified. For example, a CSS declaration with an empty value like
.b { width: ; }givesCSS1036 Expected expression, found ';'. - Errors now include the file path, error code, line and column, so you can actually find the problem in a composite bundle.
- New
NuglifySettings.ErrorBehavior-UseOriginal(the default) orThrowif you want the old fail-fast behavior. - New
NuglifySettings.EnableMinificationto turn JS and CSS minification off. NuglifySettingsnow has a parameterless constructor andinitproperties, so it's much easier to configure:
services.AddSmidge(Configuration.GetSection("smidge"), new NuglifySettings
{
EnableMinification = true,
ErrorBehavior = NuglifyErrorBehavior.UseOriginal
});Behavior change
If you were relying on bundle requests failing when NUglify couldn't parse a file, set ErrorBehavior = NuglifyErrorBehavior.Throw.
Also note that if a JS file falls back to unminified content while JS source maps are on, the bundle's source map can be inaccurate.