in Basset, Laravel

Basset – auto .min swapping

Normally, for production build, Basset runs UglifyJS to minify JavaScript, and you get pretty good results from minifying with UglifyJS.

Sometimes third party code (like in bower_components) comes with .min files, already minified files. They are most often minified with UglifyJS.

But sometimes libraries, like AngularJS, come with files minified with Google’s Closure Compiler, which can sometimes have even smaller files then UglifyJS (if you specifically optimize your code for Closure Compiler).

And if you use many of those libraries, you can cut down on your build sizes a lot.

Basset can use that. Basset has feature “auto .min swapping” which will try to discover those .min files and use their content instead of normal raw source files. Those .min files will still go through UglifyJS, but the benefits of Closure Compiler, or any other different minifier, will remain there.

So you can just use gulp production build with Bower components and never think about it. Basset will do the rest for you.

Share this ...Tweet about this on TwitterShare on FacebookEmail this to someoneShare on RedditShare on Google+Share on LinkedInPin on Pinterest