You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple PHP script to combine and minify multiple JS or CSS files passed via URI, inspired by [jsDelivr](https://www.jsdelivr.com/features/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=php-combine-scripts#combine).
8
+
A simple PHP script to combine and minify multiple JS or CSS files passed via URI, inspired by [jsDelivr](https://www.jsdelivr.com/features/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=dmhendricks%2Fphp-combine-scripts#combine).
9
9
10
10
It was created for when you have multiple scripts at a static/CDN domain, allowing you to pick and bundle different libraries based on your current needs.
11
11
12
-
Generally, it is best to combine multiple assets into bundles using a task runner such as [webpack](https://webpack.js.org/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=php-combine-scripts) or [Gulp](https://gulpjs.com/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=php-combine-scripts), but it can be handy depending on your use case.
12
+
Generally, it is best to combine multiple assets into bundles using a task runner such as [webpack](https://webpack.js.org/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=dmhendricks%2Fphp-combine-scripts) or [Gulp](https://gulpjs.com/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=dmhendricks%2Fphp-combine-scripts), but it can be handy depending on your use case.
For example, let's say that you set your `COMBINE_BASEDIR` to `/var/www/html/scipts/`. Withing this directory, you might have some JS or CSS libraries. We'll combine [Font Awesome](https://fontawesome.com/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=php-combine-scripts) with the [v4 shims](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=php-combine-scripts#shims) as an example, assuming that you have already [extracted them](https://github.com/FortAwesome/Font-Awesome/tree/master/css) to `/var/www/html/scipts/dist/css/`.
39
+
For example, let's say that you set your `COMBINE_BASEDIR` to `/var/www/html/scipts/`. Withing this directory, you might have some JS or CSS libraries. We'll combine [Font Awesome](https://fontawesome.com/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=dmhendricks%2Fphp-combine-scripts) with the [v4 shims](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4/?utm_source=github.com&utm_medium=referral&utm_content=link&utm_campaign=dmhendricks%2Fphp-combine-scripts#shims) as an example, assuming that you have already [extracted them](https://github.com/FortAwesome/Font-Awesome/tree/master/css) to `/var/www/html/scipts/dist/css/`.
40
40
41
41
To combine or minify multiple scripts, separate them with commas:
0 commit comments