How to attach external library in twig file with parameters?
In your theme.libraries.yml file add below lines

theme.social:
  js:
    'https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js' : { external: true, defer: true, async: true }


In your twig file

{{ attach_library('theme.social') }}


Clear cache &amp; it works :)