Shazwazza / Smidge

A lightweight runtime CSS/JavaScript file minification, combination, compression & management library for ASP.Net Core
MIT License
365 stars 47 forks source link

Minification Options #187

Closed jackkjhsu closed 1 year ago

jackkjhsu commented 1 year ago

Hi,

Are there any options within Smidge for minification to mangle all variables, member names and remove all unnecessary white space characters? It seems that the default minification behaviour doesn't go far enough.

Thanks for your help.

Shazwazza commented 1 year ago

Hi, yes those options are based on the Nuglify options.

The docs are missing this but they should live here https://github.com/Shazwazza/Smidge/wiki/installation#nuglify-minification-engine

The AddSmidgeNuglify takes an optional NuglifySettings parameter: https://github.com/Shazwazza/Smidge/blob/9510e0fc21b25196c5f83631a7ead16b0b5a90b0/src/Smidge.Nuglify/SmidgeNuglifyStartup.cs#L19

jackkjhsu commented 1 year ago

I guess the built-in JSMin doesn't expose any options? I'll play around with NUglify option.

Thanks Shannon.

Shazwazza commented 1 year ago

No JSMin is not 'smart' at all :) It's very fast though compared to Nuglify but also is limited with certain JS syntax and as JS evolves, unfortunately JSMin does not.