slav123 / CodeIgniter-minify

CodeIgniter minify library CSS and JavaScript compression on the fly
MIT License
226 stars 86 forks source link

how can i make a group of two compressed js for four different js files? #38

Closed sumitkalia closed 7 years ago

sumitkalia commented 7 years ago

In total, i have 4 js files and i would like to make 2 different groups of 2 js each with compression. The current deploy_js adds the rest of two in previous compressed two.

 $this->minify->add_js('pace.min.js')->add_js('animsition.min.js');
 echo $this->minify->deploy_js();
 $this->minify->add_js('scrollreveal.min.js')->add_js('footer.js');
 echo $this->minify->deploy_js();

Any thought?

michalsn commented 7 years ago

Yes, it's possible with all methods: css(), js(), add_css() and add_js(). We have second parameter for this.

$this->minify->add_js(['pace.min.js', 'animsition.min.js']);
$this->minify->add_js(['scrollreveal.min.js', 'footer.js'], 'extra');
echo $this->minify->deploy_js();
sumitkalia commented 7 years ago

Thanks Michalsn. It worked. I forgot to see the updates in thread.