0

I've created a website, that includes many different .js files, I'm looking for a way that can just simply combine all my .js files into 1 single file, that I can link without making huge changes in my code.

I've looked at multiple answers and videos but I cannot seem to replicate the results that they are talking about, every time I try to combine all my files into 1 and link it, for some reason it doesn't work. I've been tackling this problem for a good week now, and I would really appreciate some helpful suggestions.

Adem
  • 5
  • 4

1 Answers1

0

If you are developing with Laravel framework then there is a package for Laravel which is LaravelMix which will easily get you all css, js and images compressed. CSS and JS files will be merged into one like all.js and all.css

And there is one more general tool which can be used with anything is gulp. Using gulp you can do this.

Both, LaravelMix and Gulp are providing facility to set order of the js and css files to be merged. So it will maintain hierarchy even when you have only one merged css or js file.

Hope this is helpful suggestions.

Himanshu Upadhyay
  • 6,558
  • 1
  • 20
  • 33