Skip to main content
added 136 characters in body
Source Link
sonfd
  • 8.2k
  • 1
  • 20
  • 40

To add a js library to the header, define your library in my_module.libraries.yml with the header: true property.

my_library:
  header: true
  etc ...

Any dependencies defined for your library will always be loaded before your library whether loading your js in the header or footer.

See Asset loading order section here.

To add a js library to the header, define your library in my_module.libraries.yml with the header: true property.

my_library:
  header: true
  etc ...

See Asset loading order section here.

To add a js library to the header, define your library in my_module.libraries.yml with the header: true property.

my_library:
  header: true
  etc ...

Any dependencies defined for your library will always be loaded before your library whether loading your js in the header or footer.

See Asset loading order section here.

Source Link
sonfd
  • 8.2k
  • 1
  • 20
  • 40

To add a js library to the header, define your library in my_module.libraries.yml with the header: true property.

my_library:
  header: true
  etc ...

See Asset loading order section here.