How to properly load js files in the footer?

Hi, I have been looking into documentation and it seems a bit confusing, especially part with assets.add vs assets.addJS, and additional options (which do not work for me).

How can I load some script in the header (like the ones for older browsers) and other in the footer. I do not pipe scripts (npm scripts to build so I concatenate it myself).

Check for example Antimatter’s templates/partials/base.html.twig. It defines a bottom block for js by calling {{ assets.js('bottom') }}

You can add assets in that block for example by calling

{% do assets.addJs('theme://js/slidebars.min.js', {group: 'bottom'}) %}

Thanks works like a charm :slight_smile: