I need to run a jQuery file in a twig file in order to bind aqua lift segments. but jQuery is not loaded yet . How can I load jQuery at this point without loading it twice? thanks
You can override the default that the libraries are loaded in the footer and put jquery and any of your own js in the header:
libraries: - mytheme/mylibrary
The important part is
If you make a dependency on
core/jquery for the header, jquery is not loaded a second time in the footer, even if there are multiple dependencies for
core/jquery by other libraries.