Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By nod_ on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Description:
For more detailed and up to date information and examples, please see https://www.drupal.org/node/2379475.
Now that scripts need to declare their dependencies in a library. The usual way of adding scripts to a theme does not work anymore. Themes must declare their scripts in a library and add them from the info file with the libraries
key if they are required on all pages.
Drupal 8
mytheme.libraries.yml
scripts:
version: VERSION
js:
js/base.js
mytheme.info.yml
…
core: 8.x
libraries:
- mytheme/scripts
ckeditor_stylesheets:
- css/ckeditor-iframe.css
…
Impacts:
Module developers
Themers