Minify with API
Some scripts are not fully valid, but still operational (eg: missing semicolon). These scripts can cause issues when you minify them locally. If you use the API for script minify it can fix these errors, also it has better compress ratio. It can slowdown a bit the optimization, but is recommended to use it.