Ques
Ques

Reputation: 265

Concatenate Javascript files in contao

My website is using many javascript files of which some are loaded from the core. Is there any way to concatenate these js files into a single file? I've seen the usage of '|static'. But it is not wise to add '|static' into core file. So is there any way to achieve this in contao itself? I some other cms there is an option for "concatenateJS ". Like that, whether there is an option in contao core? If not, is there any other options for concatenation?

I had referred to https://rocksolidthemes.com/de/contao/blog/contao-ladezeit-optimieren. But it is not working?

Upvotes: 0

Views: 149

Answers (1)

fritzmg
fritzmg

Reputation: 2615

In Contao 4 you need to enable the Combine scripts option in your page layout. This will combine all scripts containing the |static flag into one file.

This options is enabled by default in Contao 4.5+

Upvotes: 1

Related Questions