Welcome Guest, Not a member yet? Register   Sign In
How to concatenate and minify JS files
#1

Hi folks,
I'm sorry if I'm asking a trivial question but I'm not an expert...

I have many JS files into my website that must be loaded into a single page. I know that generally is possible to concatenate and minify all files to make a single call to webserver but my question is:

Is possible to concatenate and minify JS files in CodeIgniter or more generally, how can I achieve this result? For more informations I have a webserver in which is not present Node.JS.

One alternative that I know is concatenate files with a 3rd party tool and then add a custom option in CI config to decide if files must be loaded one by one or the single merged but it would be a complete custom (and manually) procedure...
Reply
#2

Hi there,
I am also interesting how to solve this problem.
Reply
#3

Hi,
You can use to minifi js https://github.com/tedious/JShrink
You can simply concatenate minified js strings in PHP and save them to js file.
Reply
#4

User Gulp http://gulpjs.com/

Here is a good tutorial: https://www.sitepoint.com/introduction-gulp-js/
Reply
#5

(02-02-2017, 09:13 AM)usmanikram Wrote: User Gulp http://gulpjs.com/

Here is a good tutorial: https://www.sitepoint.com/introduction-gulp-js/

Thanks, that is exactly what I was looking for.
Reply
#6

(This post was last modified: 02-03-2017, 08:48 AM by Avenirer.)

..or you can try my library (https://github.com/avenirer/Assetor)...

Haven't updated it for quite some time but no one complained yet. The usage instruction can be found here: https://github.com/avenirer/Assetor/blob...r/USAGE.md
Reply




Theme © iAndrew 2016 - Forum software by © MyBB