Minification of registered assets and files

What is best way to minify the registered assets and file on a page while rendering in yii2?

I have studied about inbuilt compressor but as far as I can understand it want me to divide and compress the files , I doubt it can minify the scripts registred on view .

What can be the best option for me here.?