breezewish / express-minify

Automatically minify and cache your javascript and css files.
https://npmjs.org/package/express-minify
MIT License
86 stars 18 forks source link

How to skip minification for already minified assets? #58

Open mcandre opened 5 years ago

mcandre commented 5 years ago

Some devs have pre-minified files to serve, like self-hosted jquery.min.js, or bootstrap-min.css. What's a good rule to apply to save some CPU cycles and not re-minify these file patterns?

... Could this rule be applied to express-minify by default?

Martii commented 5 years ago

What's a good rule to apply to save some CPU cycles and not re-minify these file patterns?

With per response options it is currently res.minifyOptions.minify = false; usually somewhere in middleware. Can be conditionalled or applied globally. Conditions are up to you as with minified or not usage in your view rendering (HTML generation). :)