Minify multiple Javascript and CSS files in a folder with .Maui APIs and PHP

It’s really simple to minify multiple Javascript files in a folder with .Maui APIs and PHP.

Copy and paste the following snippet of code, insert your API key, specify folder paths in $paths array and run the PHP file. That’s all.

All JS and CSS files found in the specified folders will be minimized and saved as a copy with the extension .min.js or .min.css

Obviously your script must have permissions to create new files within the specified folders.

The script:

Leave a Comment

Your email address will not be published. Required fields are marked *